diff --git a/.changeset/README.md b/.changeset/README.md index cb151e63..3e2b26f7 100644 --- a/.changeset/README.md +++ b/.changeset/README.md @@ -11,6 +11,6 @@ We have a quick list of common questions to get you started engaging with this p The release steps follows this: -- "pnpm run prerelease" -- "pnpm i -r" -- "pnpm recursive publish" +- "bun run prerelease" +- "bun install -r" +- "bun run publish" diff --git a/.config/.eslintignore b/.config/.eslintignore deleted file mode 100644 index a7c328ab..00000000 --- a/.config/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -**/node_modules/** -**/dist/** -**/types/** -**/.next/** - -.eslintrc.js -**/*.d.ts - -**/*.js -lib/generated/** \ No newline at end of file diff --git a/.config/.eslintrc.js b/.config/.eslintrc.js deleted file mode 100644 index 126094bd..00000000 --- a/.config/.eslintrc.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - extends: ["neon/common", "neon/node", "neon/typescript", "neon/prettier"], - parserOptions: { - project: "../../tsconfig.eslint.json", - }, - rules: { - "unicorn/no-abusive-eslint-disable": "off", - "@typescript-eslint/unbound-method": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/explicit-function-return-type": "error", - "@typescript-eslint/explicit-member-accessibility": "off", - "@typescript-eslint/no-invalid-this": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/promise-function-async": "off", - "jsdoc/multiline-blocks": "off", - "jsdoc/newline-after-description": "off", - "typescript-sort-keys/interface": "off", - "@typescript-eslint/lines-between-class-members": [ - "warn", - "always", - { - exceptAfterOverload: true, - }, - ], - "@typescript-eslint/switch-exhaustiveness-check": "off", - "array-callback-return": "off", - "import/extensions": "off", - "no-param-reassign": "off", - "promise/prefer-await-to-then": "error", - "tsdoc/syntax": "off", - "sonarjs/no-nested-switch": "off", - "id-length": "off", - "no-restricted-globals": "off", - "n/prefer-global/process": "off", - "no-promise-executor-return": "off", - "jsdoc/no-undefined-types": "off", - "prettier/prettier": "off", - "n/shebang": "off" - } -}; diff --git a/.config/.eslintrc.web.js b/.config/.eslintrc.web.js deleted file mode 100644 index 923461b1..00000000 --- a/.config/.eslintrc.web.js +++ /dev/null @@ -1,27 +0,0 @@ -const path = require("path"); - -module.exports = { - extends: ["neon/common", "neon/browser", "neon/node", "neon/typescript", "neon/react", "neon/next", "neon/edge", "neon/prettier"], - settings: { - react: { - version: "detect", - }, - }, - parserOptions: { - project: "../../tsconfig.eslint.json", - ecmaFeatures: { - jsx: true, - }, - }, - rules: { - "react/react-in-jsx-scope": 0, - "react/jsx-filename-extension": [ - 1, - { - extensions: [".tsx"], - }, - ], - "react/prop-types": 0, - "@next/next/no-html-link-for-pages": [2, path.join(__dirname, "apps", "docs")], - }, -}; diff --git a/.config/.lintstagedrc.json b/.config/.lintstagedrc.json deleted file mode 100644 index 3c0d7e02..00000000 --- a/.config/.lintstagedrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/lintstagedrc.schema.json", - "*.{js,ts,tsx,jsx}": ["pnpm prettier"], - "*.{json,md,html,js,jsx,ts,tsx}": ["pnpm prettier"] -} diff --git a/.config/.prettierignore b/.config/.prettierignore deleted file mode 100644 index d3871169..00000000 --- a/.config/.prettierignore +++ /dev/null @@ -1,11 +0,0 @@ -**/node_modules/** -**/dist/** -**/types/** -**/.next/** - -pnpm-lock.yaml -.eslintrc.js -*.d.ts - -packages/**/*.js -apps/**/*.js diff --git a/.config/.prettierrc.json b/.config/.prettierrc.json deleted file mode 100644 index 7c7de399..00000000 --- a/.config/.prettierrc.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/prettierrc.json", - "endOfLine": "auto", - "printWidth": 200, - "semi": true, - "tabWidth": 4, - "trailingComma": "all", - "quoteProps": "consistent" -} diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 36f992fb..6b599330 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -9,9 +9,9 @@ If you wish to contribute to the codebase or documentation, feel free to fork th To get ready to work on the codebase, please do the following: - Fork & clone the repository, and make sure you're on the main branch -- Run pnpm install -r +- Run bun install -r - Code your heart out! -- Run pnpm run test to run ESLint and ensure any JSDoc changes are valid +- Run bun run test to run Biome and ensure any JSDoc changes are valid - Submit a pull request (Make sure you follow the conventional commit format) > Adapted from https://github.com/discordjs/discord.js/blob/master/.github/CONTRIBUTING.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74a7883e..6545b42c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,49 +11,29 @@ on: pull_request: jobs: - ci-workflow: + lint: runs-on: ubuntu-latest steps: - name: Clone repo uses: actions/checkout@v3 + - uses: oven-sh/setup-bun@v1 - - uses: pnpm/action-setup@v2 - name: Install pnpm - id: pnpm-install - with: - version: 8.6.3 - run_install: false - - - name: Get pnpm store directory - id: pnpm-cache - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + - name: Install dependencies + run: bun install - - name: Set up Node v16 - uses: actions/setup-node@v3 - with: - node-version: "16" + - name: Run linter + run: bun run check + build: + runs-on: ubuntu-latest + steps: + - name: Clone repo + uses: actions/checkout@v3 + - uses: oven-sh/setup-bun@v1 - name: Install dependencies - run: pnpm install -r + run: bun install - name: Run TypeScript Compiler - run: pnpm run build - - - name: Run linter - run: pnpm run lint - - - name: Run Prettier - run: pnpm run prettier:check + run: bun run build - # - name: Run tests - # run: pnpm run test + \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 55a353ef..66b68faa 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,27 +11,16 @@ jobs: uses: actions/checkout@v3 with: token: ${{ secrets.API_TOKEN_GITHUB }} - - - name: Install PNPM - uses: pnpm/action-setup@6e1964dde3397a825e79e4607ad57f3f7ca2c7cb - with: - version: 8.6.3 - - - name: Set up Node v16 - uses: actions/setup-node@v3 - with: - node-version: "16" - cache: "pnpm" - registry-url: " https://registry.npmjs.org" + - uses: oven-sh/setup-bun@v1 - name: Install dependencies - run: pnpm install -r + run: bun install - - name: Build Package - run: pnpm run build + - name: Build packages + run: bun run build - name: Apply version changes to packages - run: pnpm run changeset:version + run: bun run changeset:version - name: Commit package.json changes uses: EndBug/add-and-commit@v9 @@ -42,7 +31,7 @@ jobs: push: true - name: Release - run: pnpm recursive publish + run: bun recursive publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 82586325..926730d4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,26 +14,16 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - - - name: Install PNPM - uses: pnpm/action-setup@6e1964dde3397a825e79e4607ad57f3f7ca2c7cb - with: - version: 8.6.3 - - - name: Install Node v14 - uses: actions/setup-node@v3 - with: - node-version: "16" - cache: "pnpm" + - uses: oven-sh/setup-bun@v1 - name: Install dependencies - run: pnpm install -r - + run: bun install + - name: Build project - run: pnpm run build + run: bun run build - name: Build the docs - run: pnpm run docs + run: bun run docs - name: Commit the Docs uses: cpina/github-action-push-to-another-repository@main diff --git a/.husky/pre-commit b/.husky/pre-commit index edae953c..86625e2c 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx lint-staged --config .config/.lintstagedrc.json +bun run check:fix \ No newline at end of file diff --git a/apps/docs/next.config.js b/apps/docs/next.config.js index 05f7336f..22fd0d3c 100644 --- a/apps/docs/next.config.js +++ b/apps/docs/next.config.js @@ -1,20 +1,23 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - reactStrictMode: true, - swcMinify: true, - images: { - domains: ["raw.githubusercontent.com"], - }, - eslint: { - ignoreDuringBuilds: true, - }, - webpack: (config) => { - // this will override the experiments - config.experiments = { ...config.experiments, topLevelAwait: true }; - // this will just update topLevelAwait property of config.experiments - // config.experiments.topLevelAwait = true - return config; - }, + reactStrictMode: true, + swcMinify: true, + images: { + domains: ["raw.githubusercontent.com"], + }, + eslint: { + ignoreDuringBuilds: true, + }, + webpack: (config) => { + // this will override the experiments + config.experiments = { + ...config.experiments, + topLevelAwait: true, + }; + // this will just update topLevelAwait property of config.experiments + // config.experiments.topLevelAwait = true + return config; + }, }; module.exports = nextConfig; diff --git a/apps/docs/package.json b/apps/docs/package.json index 4bd84f55..8c65f58a 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -3,7 +3,6 @@ "version": "0.1.0", "private": true, "scripts": { - "lint": "eslint --ignore-path ../../.config/.eslintignore --config ../../.config/.eslintrc.web.js src", "dev": "next dev", "build": "next build", "start": "next start" @@ -28,4 +27,4 @@ "react-code-blocks": "0.0.9-0", "react-dom": "18.2.0" } -} +} \ No newline at end of file diff --git a/apps/docs/postcss.config.js b/apps/docs/postcss.config.js index 67cdf1a5..e873f1a4 100644 --- a/apps/docs/postcss.config.js +++ b/apps/docs/postcss.config.js @@ -1,6 +1,6 @@ module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, }; diff --git a/apps/docs/src/components/Breadcrumb.tsx b/apps/docs/src/components/Breadcrumb.tsx index b4b94e3c..75d78fd0 100644 --- a/apps/docs/src/components/Breadcrumb.tsx +++ b/apps/docs/src/components/Breadcrumb.tsx @@ -1,5 +1,5 @@ import type { IconDefinition } from "@fortawesome/free-solid-svg-icons"; -import { faBox, faBook, faHome } from "@fortawesome/free-solid-svg-icons"; +import { faBook, faBox, faHome } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import Link from "next/link"; import { useRouter } from "next/router"; @@ -13,15 +13,30 @@ export const Breadcrumb = () => { if (typeof lib !== "string") return null; const defaultPaths: Path[] = [ - { name: "Home", icon: faHome, path: "/" }, - { name: "Docs", icon: faBook, path: "/docs" }, - { name: lib, icon: faBox, path: `/docs/${lib}` }, + { + name: "Home", + icon: faHome, + path: "/", + }, + { + name: "Docs", + icon: faBook, + path: "/docs", + }, + { + name: lib, + icon: faBox, + path: `/docs/${lib}`, + }, ]; const splittedPaths: Path[] = asPath .split("/") .slice(3) - .map((x) => ({ name: capitalize(x), path: `/docs/${lib}/${x}` })); + .map((x) => ({ + name: capitalize(x), + path: `/docs/${lib}/${x}`, + })); const combinedPaths = [...defaultPaths, ...splittedPaths]; const activePath = combinedPaths.find((x) => x.path === asPath); if (activePath) activePath.isActive = true; @@ -32,11 +47,7 @@ export const Breadcrumb = () => { {combinedPaths.map((path, index, arr) => { const res = (
  • - + {path.icon && } {path.name} diff --git a/apps/docs/src/components/Copiable.tsx b/apps/docs/src/components/Copiable.tsx index 434b20d3..92c1f565 100644 --- a/apps/docs/src/components/Copiable.tsx +++ b/apps/docs/src/components/Copiable.tsx @@ -1,22 +1,23 @@ import { faCheck, faCopy } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { useState } from "react" +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { useState } from "react"; export const Copiable = ({ text }: { text: string }) => { const [recentlyCopied, setRecentlyCopied] = useState(false); - return
    { - await navigator.clipboard.writeText(text); - setRecentlyCopied(true); - setTimeout(() => setRecentlyCopied(false), 750); - }}> -

    - {text} - {recentlyCopied ? - - : - } -

    -
    -} \ No newline at end of file + return ( + + ); +}; diff --git a/apps/docs/src/components/Footer.tsx b/apps/docs/src/components/Footer.tsx index 327e4326..b6ab85af 100644 --- a/apps/docs/src/components/Footer.tsx +++ b/apps/docs/src/components/Footer.tsx @@ -1,28 +1,19 @@ -const HoverableLink = ({ link, children }: { children: any; link: string }) => ( - - {children} - +import React from "react"; + +const HoverableLink = ({ link, children }: { children: React.ReactNode[] | React.ReactNode; link: string }) => ( + + {children} + ); export const Footer = ({ buildDate }: { buildDate?: number }) => { - return ( -
    - - - Guilded.JS - - , docs site built with{" "} - Next.js and{" "} - - TailwindCSS - - .{" "} - - Jetbrains Mono - {" "} - is the font.{" "} - {buildDate && `Last built at ${new Date(buildDate).toISOString()}`} - -
    - ); + return ( +
    + + Guilded.JS, docs site built with Next.js and{" "} + TailwindCSS. Jetbrains Mono is the font.{" "} + {buildDate && `Last built at ${new Date(buildDate).toISOString()}`} + +
    + ); }; diff --git a/apps/docs/src/components/LayoutWrapper.tsx b/apps/docs/src/components/LayoutWrapper.tsx index 0cd85318..4d0e5c18 100644 --- a/apps/docs/src/components/LayoutWrapper.tsx +++ b/apps/docs/src/components/LayoutWrapper.tsx @@ -1,11 +1,13 @@ +import React from "react"; import { Breadcrumb } from "./Breadcrumb"; import { Footer } from "./Footer"; import { Navbar } from "./Navbar"; -export const LayoutWrapper = ({ buildDate, children }: { buildDate?: number, children: any }) => +export const LayoutWrapper = ({ buildDate, children }: { buildDate?: number; children: React.ReactNode[] | React.ReactNode }) => (
    {children}
    -
    \ No newline at end of file + +); diff --git a/apps/docs/src/components/Navbar.tsx b/apps/docs/src/components/Navbar.tsx index fd8cd709..72739b7b 100644 --- a/apps/docs/src/components/Navbar.tsx +++ b/apps/docs/src/components/Navbar.tsx @@ -2,58 +2,43 @@ import Link from "next/link"; import { useState } from "react"; const topBars = { - Docs: "/docs", - Guide: "/guide", - Github: "https://github.com/zaida04/guilded.js", - "Support Server": "https://guilded.gg/guildedjs", - "Legacy Docs": "https://guildedjs.github.io/", + Docs: "/docs", + Guide: "/guide", + Github: "https://github.com/zaida04/guilded.js", + "Support Server": "https://guilded.gg/guildedjs", + "Legacy Docs": "https://guildedjs.github.io/", }; export const Navbar = () => { - const [expanded, setExpanded] = useState(false); + const [expanded, setExpanded] = useState(false); - return ( -
    - -
    - ); + return ( +
    + +
    + ); }; diff --git a/apps/docs/src/components/PackageBadge.tsx b/apps/docs/src/components/PackageBadge.tsx index d1d90fb5..6bbc4716 100644 --- a/apps/docs/src/components/PackageBadge.tsx +++ b/apps/docs/src/components/PackageBadge.tsx @@ -3,10 +3,11 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import Link from "next/link"; import { getUnscopedPackageName } from "../lib/util"; -export const PackageBadge = ({ text }: { text: string }) => +export const PackageBadge = ({ text }: { text: string }) => (

    {text}

    - \ No newline at end of file + +); diff --git a/apps/docs/src/components/RefLink.tsx b/apps/docs/src/components/RefLink.tsx index 67c22c97..ee7bc24d 100644 --- a/apps/docs/src/components/RefLink.tsx +++ b/apps/docs/src/components/RefLink.tsx @@ -1,3 +1,7 @@ import Link from "next/link"; -export const RefLink = ({ lib, name }: { lib: string, name: string }) => {name} +export const RefLink = ({ lib, name }: { lib: string; name: string }) => ( + + {name} + +); diff --git a/apps/docs/src/components/customIcons/BreadCrumbSep.tsx b/apps/docs/src/components/customIcons/BreadCrumbSep.tsx index 23df3364..2eee1358 100644 --- a/apps/docs/src/components/customIcons/BreadCrumbSep.tsx +++ b/apps/docs/src/components/customIcons/BreadCrumbSep.tsx @@ -1,7 +1,9 @@ -import { memo } from "react" +import { memo } from "react"; export const BreadCrumbSep = memo(() => { - return -}) \ No newline at end of file + return ( + + ); +}); diff --git a/apps/docs/src/lib/types.ts b/apps/docs/src/lib/types.ts index d4fe4b54..38872690 100644 --- a/apps/docs/src/lib/types.ts +++ b/apps/docs/src/lib/types.ts @@ -2,9 +2,9 @@ import type { DeclarationReflection } from "typedoc/dist/lib/models/reflections/ export type EntityType = { comment?: { summary: { kind: string; text: string }[] }; name: string }; export type Entity = { - accessors: DeclarationReflection[]; - constructors: DeclarationReflection[]; - methods: DeclarationReflection[]; - name: string; - properties: DeclarationReflection[]; + accessors: DeclarationReflection[]; + constructors: DeclarationReflection[]; + methods: DeclarationReflection[]; + name: string; + properties: DeclarationReflection[]; }; diff --git a/apps/docs/src/pages/_app.tsx b/apps/docs/src/pages/_app.tsx index 8aa6800f..94846a88 100644 --- a/apps/docs/src/pages/_app.tsx +++ b/apps/docs/src/pages/_app.tsx @@ -1,11 +1,17 @@ -import '../styles/globals.css' -import '@fortawesome/fontawesome-svg-core/styles.css'; -import localFont from '@next/font/local' -import type { AppProps } from 'next/app' +import "@fortawesome/fontawesome-svg-core/styles.css"; +import localFont from "@next/font/local"; +import type { AppProps } from "next/app"; +import "../styles/globals.css"; -const Mono = localFont({ src: '../styles/fonts/webfonts/JetBrainsMono-Regular.woff2', variable: '--font-mono', display: "swap" }) +const Mono = localFont({ + src: "../styles/fonts/webfonts/JetBrainsMono-Regular.woff2", + variable: "--font-mono", + display: "swap", +}); export default function App({ Component, pageProps }: AppProps) { - return
    - -
    + return ( +
    + +
    + ); } diff --git a/apps/docs/src/pages/docs/index.tsx b/apps/docs/src/pages/docs/index.tsx index 5add96ba..2473785c 100644 --- a/apps/docs/src/pages/docs/index.tsx +++ b/apps/docs/src/pages/docs/index.tsx @@ -11,9 +11,9 @@ type Props = { packages: string[] }; // }; const Docs: NextPage = ({ packages }) => { - return ( - - {/*
    + return ( + + {/*
    = ({ packages }) => {
    */} -
    -

    Packages:

    - -
    -

    - Click here for stable docs -

    -
    -
    - {/* {packages +
    +

    Packages:

    + +
    +

    Click here for stable docs

    +
    +
    + {/* {packages .sort((a, b) => a.length - b.length) .map((x) => ( ))} */} -
    - - ); +
    +
    + ); }; export default Docs; diff --git a/apps/docs/src/pages/index.tsx b/apps/docs/src/pages/index.tsx index 656697ca..134ceeb6 100644 --- a/apps/docs/src/pages/index.tsx +++ b/apps/docs/src/pages/index.tsx @@ -24,12 +24,13 @@ export const getStaticProps = (): GetStaticPropsResult<{ buildDate: number }> => const buildDate = Date.now(); return { props: { - buildDate - } - } -} + buildDate, + }, + }; +}; -const description = "Guilded.js is a library written in TypeScript usable in either TypeScript or JavaScript projects. It provides structures, abstractions, and utilities for interaction with the Guilded API."; +const description = + "Guilded.js is a library written in TypeScript usable in either TypeScript or JavaScript projects. It provides structures, abstractions, and utilities for interaction with the Guilded API."; export default function Home({ buildDate }: InferGetStaticPropsType) { return ( @@ -54,7 +55,9 @@ export default function Home({ buildDate }: InferGetStaticPropsType
    - {["npm install guilded.js", "yarn add guilded.js", "pnpm add guilded.js"].map(click => )} + {["npm install guilded.js", "yarn add guilded.js", "pnpm add guilded.js"].map((click) => ( + + ))}
    @@ -74,5 +77,5 @@ export default function Home({ buildDate }: InferGetStaticPropsType - ) + ); } diff --git a/apps/docs/tailwind.config.js b/apps/docs/tailwind.config.js index 0b34a9fb..98643746 100644 --- a/apps/docs/tailwind.config.js +++ b/apps/docs/tailwind.config.js @@ -1,37 +1,34 @@ const colors = require("tailwindcss/colors"); const { fontFamily } = require("tailwindcss/defaultTheme"); -delete colors["lightBlue"]; -delete colors["warmGray"]; -delete colors["trueGray"]; -delete colors["coolGray"]; -delete colors["blueGray"]; +colors.lightBlue = undefined; +colors.warmGray = undefined; +colors.trueGray = undefined; +colors.coolGray = undefined; +colors.blueGray = undefined; /** @type {import('tailwindcss').Config} */ module.exports = { - content: ["./src/**/*.{js,ts,jsx,tsx}"], - theme: { - extend: { - fontFamily: { - sans: ["var(--font-mono)", ...fontFamily.sans], - }, - colors: { - ...colors, - }, - borderWidth: { - ".5": ".5px", - }, - borderColor: { - guilded: "#F5C400", - slate: "#292B32", - }, - colors: { - gray: "#191B1F", - guilded: "#F5C400", - black: "#111820", - slate: "#292B32", - white: "#ececee", - }, - }, - }, - plugins: [], + content: ["./src/**/*.{js,ts,jsx,tsx}"], + theme: { + extend: { + fontFamily: { + sans: ["var(--font-mono)", ...fontFamily.sans], + }, + borderWidth: { + ".5": ".5px", + }, + borderColor: { + guilded: "#F5C400", + slate: "#292B32", + }, + colors: { + gray: "#191B1F", + guilded: "#F5C400", + black: "#111820", + slate: "#292B32", + white: "#ececee", + }, + }, + }, + plugins: [], }; diff --git a/biome.json b/biome.json new file mode 100644 index 00000000..88627a6a --- /dev/null +++ b/biome.json @@ -0,0 +1,36 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.4.1/schema.json", + "organizeImports": { + "enabled": true + }, + "files": { + "ignore": [ + "dist", + "node_modules", + "types", + ".next", + "generated", + "*.json" + ] + }, + "formatter": { + "enabled": true, + "lineEnding": "lf", + "indentWidth": 2, + "indentStyle": "tab", + "lineWidth": 200 + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "style": { + "noNonNullAssertion": "off", + "noParameterAssign": "off" + }, + "suspicious": { + "noArrayIndexKey": "off" + } + } + } +} \ No newline at end of file diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 00000000..8f7b1c96 Binary files /dev/null and b/bun.lockb differ diff --git a/package.json b/package.json index 32f198dc..03b5055b 100644 --- a/package.json +++ b/package.json @@ -1,63 +1,59 @@ { - "name": "@guildedjs/main", - "private": true, - "version": "0.0.0", - "description": "Overarching repository for the Guilded.JS repository", - "author": "Zaid \"Nico\" ", - "scripts": { - "build": "pnpm --filter=!docs recursive run build", - "build:typecheck": "pnpm --filter=!docs recursive run build:typecheck", - "lint": "pnpm recursive --no-bail run lint", - "lint:fix": "pnpm run lint --fix", - "prettier": "prettier --ignore-path .config/.prettierignore --config .config/.prettierrc.json --write **/*.{ts,js,json,yml,yaml,md}", - "prettier:check": "prettier --ignore-path .config/.prettierignore --config .config/.prettierrc.json --check **/*.{ts,js,json,yml,yaml,md}", - "changeset": "changeset", - "changeset:version": "changeset version", - "docs": "typedoc && cd docs && find . -type f -name \"*.html\" -exec sed -i'' -e 's/__namedParameters/options/g' {} +", - "prepublishOnly": "pnpm run lint && pnpm recursive run prepublishOnly", - "prepare": "husky install" + "name": "@guildedjs/main", + "private": true, + "version": "0.0.0", + "description": "Overarching repository for the Guilded.JS repository", + "author": "Zaid \"Nico\" ", + "scripts": { + "build": "turbo run build", + "build:typecheck": "turbo run build:typecheck", + "check": "biome check apps packages services", + "check:fix": "biome check --apply-unsafe apps packages services", + "changeset": "changeset", + "changeset:version": "changeset version", + "docs": "typedoc && cd docs && find . -type f -name \"*.html\" -exec sed -i'' -e 's/__namedParameters/options/g' {} +", + "prepublishOnly": "turbo run prepublishOnly", + "prepare": "husky install" + }, + "devDependencies": { + "@biomejs/biome": "1.5.2", + "@changesets/cli": "^2.26.1", + "@types/node": "18.16.12", + "dotenv": "16.0.3", + "gen-esm-wrapper": "1.1.3", + "husky": "7.0.4", + "lint-staged": "13.2.2", + "nodemon": "^2.0.22", + "rimraf": "5.0.1", + "turbo": "^1.11.2", + "typedoc": "0.24.7", + "typescript": "5.0.4" + }, + "contributors": [ + { + "name": "Zaid \"Nico\"", + "email": "contact@nico.engineer", + "url": "https://github.com/zaida04" }, - "devDependencies": { - "@changesets/cli": "^2.26.1", - "@types/node": "18.16.12", - "dotenv": "16.0.3", - "eslint": "8.40.0", - "eslint-config-neon": "0.1.47", - "gen-esm-wrapper": "1.1.3", - "husky": "7.0.4", - "lint-staged": "13.2.2", - "nodemon": "^2.0.22", - "pnpm": "8.5.1", - "prettier": "2.8.8", - "rimraf": "5.0.1", - "ts-node": "10.9.1", - "typedoc": "0.24.7", - "typescript": "5.0.4" + { + "name": "Skillz4Killz", + "email": "guildedjs@drskillz.33mail.com", + "url": "https://github.com/Skillz4Killz" }, - "contributors": [ - { - "name": "Zaid \"Nico\"", - "email": "contact@nico.engineer", - "url": "https://github.com/zaida04" - }, - { - "name": "Skillz4Killz", - "email": "guildedjs@drskillz.33mail.com", - "url": "https://github.com/Skillz4Killz" - }, - { - "name": "Uhuh \"Dylan\"", - "email": "dylan@panku.io", - "url": "https://github.com/uhuh" - }, - { - "name": "DaStormer", - "email": "dastormer@stormdevelopmentz.xyz", - "url": "https://github.com/DaStormer" - } - ], - "engines": { - "npm": "only-allow pnpm", - "node": ">= 16.0.0" + { + "name": "Uhuh \"Dylan\"", + "email": "dylan@panku.io", + "url": "https://github.com/uhuh" + }, + { + "name": "DaStormer", + "email": "dastormer@stormdevelopmentz.xyz", + "url": "https://github.com/DaStormer" } -} + ], + "workspaces": [ + "packages/*", + "services/*", + "apps/*" + ] +} \ No newline at end of file diff --git a/packages/api/__tests__/file-sending/src/index.ts b/packages/api/__tests__/file-sending/src/index.ts index abc74120..0b9474dc 100644 --- a/packages/api/__tests__/file-sending/src/index.ts +++ b/packages/api/__tests__/file-sending/src/index.ts @@ -4,7 +4,12 @@ import { WebhookClient } from "../../../lib/webhook/WebhookClient"; const client = new WebhookClient(""); void (async (): Promise => { - return client.send({ - files: [{ name: "bbb.png", content: readFileSync("./bbb.png") }], - }); + return client.send({ + files: [ + { + name: "bbb.png", + content: readFileSync("./bbb.png"), + }, + ], + }); })(); diff --git a/packages/api/lib/generated/api-typings/index.ts b/packages/api/lib/generated/api-typings/index.ts index 789dc649..fb0d5430 100644 --- a/packages/api/lib/generated/api-typings/index.ts +++ b/packages/api/lib/generated/api-typings/index.ts @@ -7,5 +7,6 @@ export type JSON = T["application/json"]; export type WSSchema = components["schemas"][T]; export type WSContent = { content: JSONContent }; -export type WSPayload = components["responses"][T]["content"]["application/json"]; +export type WSPayload = + components["responses"][T]["content"]["application/json"]; export type WSPacket = SkeletonWSPayload & { d: WSPayload }; diff --git a/packages/api/lib/generated/api-typings/v1/events.ts b/packages/api/lib/generated/api-typings/v1/events.ts index 9eebd5aa..58c400fb 100644 --- a/packages/api/lib/generated/api-typings/v1/events.ts +++ b/packages/api/lib/generated/api-typings/v1/events.ts @@ -1,62 +1,62 @@ export enum WSOpCodes { - SUCCESS, - WELCOME, - RESUME, - ERROR = 8, - PING, - PONG, + SUCCESS = 0, + WELCOME = 1, + RESUME = 2, + ERROR = 8, + PING = 9, + PONG = 10, } export const WebSocketEvents = { - CalendarEventCreated: "CalendarEventCreated", - CalendarEventUpdated: "CalendarEventUpdated", - CalendarEventDeleted: "CalendarEventDeleted", - CalendarEventRsvpUpdated: "CalendarEventRsvpUpdated", - CalendarEventRsvpManyUpdated: "CalendarEventRsvpManyUpdated", - CalendarEventRsvpDeleted: "CalendarEventRsvpDeleted", - ChatMessageCreated: "ChatMessageCreated", - ChatMessageUpdated: "ChatMessageUpdated", - ChatMessageDeleted: "ChatMessageDeleted", - ServerMemberJoined: "ServerMemberJoined", - ServerMemberRemoved: "ServerMemberRemoved", - ServerMemberUpdated: "ServerMemberUpdated", - ServerMemberBanned: "ServerMemberBanned", - ServerMemberUnbanned: "ServerMemberUnbanned", - ServerMemberSocialLinkCreated: "ServerMemberSocialLinkCreated", - ServerMemberSocialLinkUpdated: "ServerMemberSocialLinkUpdated", - ServerMemberSocialLinkDeleted: "ServerMemberSocialLinkDeleted", - BotServerMembershipCreated: "BotServerMembershipCreated", - BotServerMembershipDeleted: "BotServerMembershipDeleted", - ServerRolesUpdated: "ServerRolesUpdated", - ServerWebhookCreated: "ServerWebhookCreated", - ServerWebhookUpdated: "ServerWebhookUpdated", - ListItemCompleted: "ListItemCompleted", - ListItemUncompleted: "ListItemUncompleted", - ListItemCreated: "ListItemCreated", - ListItemUpdated: "ListItemUpdated", - ListItemDeleted: "ListItemDeleted", - ServerChannelCreated: "ServerChannelCreated", - ServerChannelUpdated: "ServerChannelUpdated", - ServerChannelDeleted: "ServerChannelDeleted", - DocCreated: "DocCreated", - DocUpdated: "DocUpdated", - DocDeleted: "DocDeleted", - ChannelMessageReactionCreated: "ChannelMessageReactionCreated", - ChannelMessageReactionDeleted: "ChannelMessageReactionDeleted", - ForumTopicCreated: "ForumTopicCreated", - ForumTopicUpdated: "ForumTopicUpdated", - ForumTopicDeleted: "ForumTopicDeleted", - ForumTopicPinned: "ForumTopicPinned", - ForumTopicUnpinned: "ForumTopicUnpinned", - ForumTopicLocked: "ForumTopicLocked", - ForumTopicUnlocked: "ForumTopicUnlocked", + CalendarEventCreated: "CalendarEventCreated", + CalendarEventUpdated: "CalendarEventUpdated", + CalendarEventDeleted: "CalendarEventDeleted", + CalendarEventRsvpUpdated: "CalendarEventRsvpUpdated", + CalendarEventRsvpManyUpdated: "CalendarEventRsvpManyUpdated", + CalendarEventRsvpDeleted: "CalendarEventRsvpDeleted", + ChatMessageCreated: "ChatMessageCreated", + ChatMessageUpdated: "ChatMessageUpdated", + ChatMessageDeleted: "ChatMessageDeleted", + ServerMemberJoined: "ServerMemberJoined", + ServerMemberRemoved: "ServerMemberRemoved", + ServerMemberUpdated: "ServerMemberUpdated", + ServerMemberBanned: "ServerMemberBanned", + ServerMemberUnbanned: "ServerMemberUnbanned", + ServerMemberSocialLinkCreated: "ServerMemberSocialLinkCreated", + ServerMemberSocialLinkUpdated: "ServerMemberSocialLinkUpdated", + ServerMemberSocialLinkDeleted: "ServerMemberSocialLinkDeleted", + BotServerMembershipCreated: "BotServerMembershipCreated", + BotServerMembershipDeleted: "BotServerMembershipDeleted", + ServerRolesUpdated: "ServerRolesUpdated", + ServerWebhookCreated: "ServerWebhookCreated", + ServerWebhookUpdated: "ServerWebhookUpdated", + ListItemCompleted: "ListItemCompleted", + ListItemUncompleted: "ListItemUncompleted", + ListItemCreated: "ListItemCreated", + ListItemUpdated: "ListItemUpdated", + ListItemDeleted: "ListItemDeleted", + ServerChannelCreated: "ServerChannelCreated", + ServerChannelUpdated: "ServerChannelUpdated", + ServerChannelDeleted: "ServerChannelDeleted", + DocCreated: "DocCreated", + DocUpdated: "DocUpdated", + DocDeleted: "DocDeleted", + ChannelMessageReactionCreated: "ChannelMessageReactionCreated", + ChannelMessageReactionDeleted: "ChannelMessageReactionDeleted", + ForumTopicCreated: "ForumTopicCreated", + ForumTopicUpdated: "ForumTopicUpdated", + ForumTopicDeleted: "ForumTopicDeleted", + ForumTopicPinned: "ForumTopicPinned", + ForumTopicUnpinned: "ForumTopicUnpinned", + ForumTopicLocked: "ForumTopicLocked", + ForumTopicUnlocked: "ForumTopicUnlocked", } as const; export type WSEvent = typeof WebSocketEvents; export type WSEventNames = keyof WSEvent; export type SkeletonWSPayload = { - d: unknown; - op: WSOpCodes; - s?: string; - t: keyof WSEvent; + d: unknown; + op: WSOpCodes; + s?: string; + t: keyof WSEvent; }; diff --git a/packages/api/lib/generated/api-typings/v1/structs/Client.ts b/packages/api/lib/generated/api-typings/v1/structs/Client.ts index 3f20c430..982f84b9 100644 --- a/packages/api/lib/generated/api-typings/v1/structs/Client.ts +++ b/packages/api/lib/generated/api-typings/v1/structs/Client.ts @@ -1,6 +1,6 @@ import type { WSPayload } from "../.."; export type ClientUserData = WSPayload<"_WelcomeMessage">["user"] & { - createdBy: string; - botId: string; + createdBy: string; + botId: string; }; diff --git a/packages/api/lib/generated/api-typings/v1/structs/Embed.ts b/packages/api/lib/generated/api-typings/v1/structs/Embed.ts index 3ab45efe..fa41b9b7 100644 --- a/packages/api/lib/generated/api-typings/v1/structs/Embed.ts +++ b/packages/api/lib/generated/api-typings/v1/structs/Embed.ts @@ -1,70 +1,70 @@ export type EmbedPayload = { - author?: EmbedAuthor; - color?: number; - description?: string; - fields?: EmbedField[]; - footer?: EmbedFooter; - image?: EmbedImage; - thumbnail?: EmbedImage; - timestamp?: string; - title?: string; - url?: string; + author?: EmbedAuthor; + color?: number; + description?: string; + fields?: EmbedField[]; + footer?: EmbedFooter; + image?: EmbedImage; + thumbnail?: EmbedImage; + timestamp?: string; + title?: string; + url?: string; }; export type EmbedFooter = { - icon_url?: string; - text: string; + icon_url?: string; + text: string; }; export type EmbedImage = { - url: string; + url: string; }; export type EmbedAuthor = { - icon_url?: string; - name: string; - url?: string; + icon_url?: string; + name: string; + url?: string; }; export type EmbedField = { - inline?: boolean; - name: string; - value: string; + inline?: boolean; + name: string; + value: string; }; // embed struct for the client API, webhooks mainly export type APIEmbed = EmbedPayload & { - author?: APIEmbedAuthor; - footer?: APIEmbedFooter; - image?: APIEmbedImage; - provider?: APIEmbedProvider; - thumbnail?: APIEmbedThumbnail; - video?: APIEmbedVideo; + author?: APIEmbedAuthor; + footer?: APIEmbedFooter; + image?: APIEmbedImage; + provider?: APIEmbedProvider; + thumbnail?: APIEmbedThumbnail; + video?: APIEmbedVideo; }; export type APIEmbedFooter = { - icon_url?: string; - proxy_icon_url?: string; - text: string; + icon_url?: string; + proxy_icon_url?: string; + text: string; }; export type APIEmbedImage = { - height?: string; - proxy_url?: string; - url: string; - width?: string; + height?: string; + proxy_url?: string; + url: string; + width?: string; }; export type APIEmbedThumbnail = APIEmbedImage; export type APIEmbedVideo = APIEmbedImage; export type APIEmbedProvider = { - name?: string; - url?: string; + name?: string; + url?: string; }; export type APIEmbedAuthor = { - icon_url?: string; - name: string; - proxy_icon_url?: string; - url?: string; + icon_url?: string; + name: string; + proxy_icon_url?: string; + url?: string; }; diff --git a/packages/api/lib/generated/api-typings/v1/structs/Webhook.ts b/packages/api/lib/generated/api-typings/v1/structs/Webhook.ts index 2d36aa43..3af631ac 100644 --- a/packages/api/lib/generated/api-typings/v1/structs/Webhook.ts +++ b/packages/api/lib/generated/api-typings/v1/structs/Webhook.ts @@ -1,48 +1,52 @@ export type WebhookContentPayload = { - botId: string | null; - channelId: string; - content: APIContent; - createdAt: string; - createdBy: string; - id: string; - type: string; - webhookId: string; + botId: + | string + | null; + channelId: string; + content: APIContent; + createdAt: string; + createdBy: string; + id: string; + type: string; + webhookId: string; }; export type APIContent = { - document: APIDocument; - object: string; + document: APIDocument; + object: string; }; type APILeaf = { - marks: APIMark[]; - object: string | "leaf"; - text: string; + marks: APIMark[]; + object: + | string + | "leaf"; + text: string; }; type APIMark = { - data: unknown; - object: string; - type: string; + data: unknown; + object: string; + type: string; }; type APIDocument = { - data: unknown; - nodes: APIDocumentNode[]; - object: string; + data: unknown; + nodes: APIDocumentNode[]; + object: string; }; type APIDocumentNode = { - data: unknown; - nodes: APINestedNode[]; - object: string; - type: string; + data: unknown; + nodes: APINestedNode[]; + object: string; + type: string; }; type APINestedNode = { - data?: unknown; - leaves?: APILeaf[]; - nodes?: APINestedNode[]; - object: string; - type?: string; + data?: unknown; + leaves?: APILeaf[]; + nodes?: APINestedNode[]; + object: string; + type?: string; }; diff --git a/packages/api/lib/generated/api-typings/v1/webhook.ts b/packages/api/lib/generated/api-typings/v1/webhook.ts index 139fa617..97a0be79 100644 --- a/packages/api/lib/generated/api-typings/v1/webhook.ts +++ b/packages/api/lib/generated/api-typings/v1/webhook.ts @@ -6,11 +6,17 @@ import type { WebhookContentPayload } from "./structs/Webhook"; * /webhooks/:webhookId/:webhookToken */ export type RESTPostWebhookBody = { - avatar_url?: string; - content?: string; - embeds?: APIEmbed[]; - payload_json?: Pick; - username?: string; + avatar_url?: string; + content?: string; + embeds?: APIEmbed[]; + payload_json?: Pick< + RESTPostWebhookBody, + | "avatar_url" + | "content" + | "embeds" + | "username" + >; + username?: string; }; export type RESTPostWebhookResult = WebhookContentPayload; diff --git a/packages/api/lib/generated/api-typings/v1/ws.ts b/packages/api/lib/generated/api-typings/v1/ws.ts index 94482029..81be3f06 100644 --- a/packages/api/lib/generated/api-typings/v1/ws.ts +++ b/packages/api/lib/generated/api-typings/v1/ws.ts @@ -8,3330 +8,3383 @@ export type paths = Record; export type webhooks = Record; export type components = { - schemas: { - _SocketEventEnvelope: { - /** - * Opcode - * - * @description An operation code corresponding to the nature of the sent message (for example, success, failure, etc.) - * @enum {integer} - */ - op: 0 | 1 | 2 | 8 | 9; - /** - * Data - * - * @description Data of any form depending on the underlying event - */ - d?: Record; - /** - * Message ID - * - * @description Message ID used for replaying events after a disconnect - */ - s?: string; - /** - * Event name - * - * @description Event name for the given message - */ - t?: string; - }; - /** - * @example { - * "id": "00000000-0000-0000-0000-000000000000", - * "type": "default", - * "serverId": "wlVr3Ggl", - * "groupId": "ZVzBo83p", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "content": "Hello **world**!", - * "embeds": [ - * { - * "title": "embed title", - * "description": "embeds support a **different** __subset__ *of* markdown than other markdown fields. <@Ann6LewA>\n\n [links](https://www.guilded.gg) ```\ncheck this code out```\n\n:pizza: time!! ttyl", - * "url": "https://www.guilded.gg", - * "color": 6118369, - * "timestamp": "2022-04-12T22:14:36.737Z", - * "footer": { - * "icon_url": "https://www.guilded.gg/asset/Logos/logomark/Color/Guilded_Logomark_Color.png", - * "text": "footer text" - * }, - * "thumbnail": { - * "url": "https://www.guilded.gg/asset/Logos/logomark/Color/Guilded_Logomark_Color.png" - * }, - * "image": { - * "url": "https://www.guilded.gg/asset/Logos/logomark_wordmark/Color/Guilded_Logomark_Wordmark_Color.png" - * }, - * "author": { - * "name": "Gil", - * "url": "https://www.guilded.gg", - * "icon_url": "https://www.guilded.gg/asset/Default/Gil-md.png" - * }, - * "fields": [ - * { - * "name": "hello", - * "value": "these are fields" - * }, - * { - * "name": "~~help i have been crossed out~~", - * "value": "~~oh noes~~", - * "inline": true - * }, - * { - * "name": "another inline", - * "value": "field", - * "inline": true - * } - * ] - * } - * ], - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA" - * } - */ - ChatMessage: { - /** - * Message ID - * Format: uuid - * - * @description The ID of the message - */ - id: string; - /** - * Type - * - * @description The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated. - * @enum {string} - */ - type: "default" | "system"; - /** - * Server ID - * - * @description The ID of the server - */ - serverId?: string; - /** - * Group ID - * - * @description The ID of the group - */ - groupId?: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Content - * Format: markdown - * - * @description The content of the message - */ - content?: string; - embeds?: components["schemas"]["ChatEmbed"][]; - /** @description Message IDs that were replied to */ - replyMessageIds?: string[]; - /** - * Is private - * - * @description If set, this message will only be seen by those mentioned or replied to - */ - isPrivate?: boolean; - /** - * Is silent - * - * @description If set, this message did not notify mention or reply recipients - * @default false - */ - isSilent?: boolean; - mentions?: components["schemas"]["Mentions"]; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the message was created at - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this message (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * Created by Webhook ID - * - * @description The ID of the webhook who created this message, if it was created by a webhook - */ - createdByWebhookId?: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the message was updated at, if relevant - */ - updatedAt?: string; - }; - /** - * @example { - * "channelId": "00000000-0000-0000-0000-000000000000", - * "createdBy": "Ann6LewA", - * "emote": { - * "id": 90000000, - * "name": "grinning", - * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" - * }, - * "messageId": "00000000-0000-0000-0000-000000000000" - * } - */ - ChatMessageReaction: { - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * User ID - * - * @description The ID of the user who added the reaction - */ - createdBy: string; - emote: components["schemas"]["Emote"]; - /** - * Message ID - * Format: uuid - * - * @description The ID of the message - */ - messageId: string; - }; - /** - * @description Rich content sections optionally associated with chat messages. Properties with "webhook-markdown" support allow for the following: link, italic, bold, strikethrough, underline, inline code, block code, reaction, and mention. - * @example { - * "title": "embed title", - * "description": "embeds support a **different** __subset__ *of* markdown than other markdown fields. <@Ann6LewA>\n\n [links](https://www.guilded.gg) ```\ncheck this code out```\n\n:pizza: time!! ttyl", - * "url": "https://www.guilded.gg", - * "color": 6118369, - * "timestamp": "2022-04-12T22:14:36.737Z", - * "footer": { - * "icon_url": "https://www.guilded.gg/asset/Logos/logomark/Color/Guilded_Logomark_Color.png", - * "text": "footer text" - * }, - * "thumbnail": { - * "url": "https://www.guilded.gg/asset/Logos/logomark/Color/Guilded_Logomark_Color.png" - * }, - * "image": { - * "url": "https://www.guilded.gg/asset/Logos/logomark_wordmark/Color/Guilded_Logomark_Wordmark_Color.png" - * }, - * "author": { - * "name": "Gil", - * "url": "https://www.guilded.gg", - * "icon_url": "https://www.guilded.gg/asset/Default/Gil-md.png" - * }, - * "fields": [ - * { - * "name": "hello", - * "value": "these are fields" - * }, - * { - * "name": "~~help i have been crossed out~~", - * "value": "~~oh noes~~", - * "inline": true - * }, - * { - * "name": "another inline", - * "value": "field", - * "inline": true - * } - * ] - * } - */ - ChatEmbed: { - /** - * Format: webhook-markdown - * - * @description Main header of the embed - */ - title?: string; - /** - * Format: webhook-markdown - * - * @description Subtext of the embed - */ - description?: string; - /** - * Format: uri - * - * @description URL to linkify the `title` field with - */ - url?: string; - /** @description Decimal value of the color that the left border should be */ - color?: number; - /** @description A small section at the bottom of the embed */ - footer?: { - /** - * Format: media-uri - * - * @description URL of a small image to put in the footer - */ - icon_url?: string; - /** @description Text of the footer */ - text: string; - }; - /** - * Format: date-time - * - * @description A timestamp to put in the footer - */ - timestamp?: string; - /** @description An image to the right of the embed's content */ - thumbnail?: { - /** - * Format: media-uri - * - * @description URL of the image - */ - url?: string; - }; - /** @description The main picture to associate with the embed */ - image?: { - /** - * Format: media-uri - * - * @description URL of the image - */ - url?: string; - }; - /** @description A small section above the title of the embed */ - author?: { - /** @description Name of the author */ - name?: string; - /** - * Format: uri - * - * @description URL to linkify the author's `name` field - */ - url?: string; - /** - * Format: media-uri - * - * @description URL of a small image to display to the left of the author's `name` - */ - icon_url?: string; - }; - /** @description Table-like cells to add to the embed */ - fields?: { - /** - * Format: webhook-markdown - * - * @description Header of the table-like cell - */ - name: string; - /** - * Format: webhook-markdown - * - * @description Subtext of the table-like cell - */ - value: string; - /** - * @description If the field should wrap or not - * @default false - */ - inline?: boolean; - }[]; - }; - /** - * @example { - * "type": "roblox", - * "userId": "Ann6LewA", - * "handle": "builderman", - * "serviceId": "156", - * "createdAt": "2006-03-08T20:15:00.706Z" - * } - */ - SocialLink: { - /** - * Social link type - * - * @description The type of social link that Guilded supports. Depending on this value, `handle` or `serviceId` may or may not be present - * @enum {string} - */ - type: "bnet" | "epic" | "facebook" | "origin" | "patreon" | "psn" | "roblox" | "steam" | "switch" | "twitch" | "twitter" | "xbox" | "youtube"; - /** - * User ID - * - * @description The ID of the user that the social link is associated with - */ - userId: string; - /** @description The handle of the user within the external service */ - handle?: string; - /** @description The unique ID that represents this member's social link within the external service */ - serviceId?: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the social link was created at - */ - createdAt: string; - }; - /** - * @description Metadata of who or what is mentioned in content - * @example { - * "users": [ - * { - * "id": "Ann6LewA" - * } - * ], - * "channels": [ - * { - * "id": "00000000-0000-0000-0000-000000000000" - * } - * ], - * "roles": [ - * { - * "id": 591232 - * } - * ], - * "everyone": true, - * "here": true - * } - */ - Mentions: { - /** - * Users - * - * @description Info on mentioned users - */ - users?: { - /** - * User ID - * - * @description The ID of the user - */ - id: string; - }[]; - /** - * Channels - * - * @description Info on mentioned channels - */ - channels?: { - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - id: string; - }[]; - /** - * Roles - * - * @description Info on mentioned roles - */ - roles?: { - /** - * Role ID - * - * @description The ID of the role - */ - id: number; - }[]; - /** - * Everyone - * - * @description If @everyone was mentioned - */ - everyone?: boolean; - /** - * Here - * - * @description If @here was mentioned - */ - here?: boolean; - }; - /** - * @example { - * "id": 1234567890, - * "content": "Great idea!", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "forumTopicId": 2036274747, - * "createdBy": "Ann6LewA" - * } - */ - ForumTopicComment: { - /** @description The ID of the forum topic comment */ - id: number; - /** - * Content - * Format: markdown - * - * @description The content of the forum topic comment - */ - content: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the forum topic comment was created at - */ - createdAt: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the forum topic comment was updated at, if relevant - */ - updatedAt?: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** @description The ID of the forum topic */ - forumTopicId: number; - /** - * Created by - * - * @description The ID of the user who created this forum topic comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - mentions?: components["schemas"]["Mentions"]; - }; - /** - * @example { - * "channelId": "00000000-0000-0000-0000-000000000000", - * "createdBy": "Ann6LewA", - * "emote": { - * "id": 90000000, - * "name": "grinning", - * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" - * }, - * "forumTopicId": 123456 - * } - */ - ForumTopicReaction: { - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * User ID - * - * @description The ID of the user who added the reaction - */ - createdBy: string; - emote: components["schemas"]["Emote"]; - /** @description The ID of the forum topic */ - forumTopicId: number; - }; - /** - * @example { - * "channelId": "00000000-0000-0000-0000-000000000000", - * "createdBy": "Ann6LewA", - * "emote": { - * "id": 90000000, - * "name": "grinning", - * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" - * }, - * "forumTopicId": 123456, - * "forumTopicCommentId": 1234567890 - * } - */ - ForumTopicCommentReaction: { - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * User ID - * - * @description The ID of the user who added the reaction - */ - createdBy: string; - emote: components["schemas"]["Emote"]; - /** @description The ID of the forum topic */ - forumTopicId: number; - /** @description The ID of the forum topic comment */ - forumTopicCommentId: number; - }; - /** - * @example { - * "id": 123456, - * "serverId": "wlVr3Ggl", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "title": "Welcome new members!!", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA", - * "content": "Please introduce yourself in this topic!!!" - * } - */ - ForumTopic: { - /** @description The ID of the forum topic */ - id: number; - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Title - * - * @description The title of the forum topic - */ - title: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the forum topic was created at - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this forum topic (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the forum topic was updated at, if relevant - */ - updatedAt?: string; - /** - * Bumped at - * Format: date-time - * - * @description The ISO 8601 timestamp that the forum topic was bumped at. This timestamp is updated whenever there is any activity on the posts within the forum topic. - */ - bumpedAt?: string; - /** - * Is pinned - * - * @default false - */ - isPinned?: boolean; - /** - * Is locked - * - * @default false - */ - isLocked?: boolean; - /** - * Content - * Format: markdown - * - * @description The content of the forum topic - */ - content: string; - mentions?: components["schemas"]["Mentions"]; - }; - /** - * @example { - * "id": 123456, - * "serverId": "wlVr3Ggl", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "title": "Welcome new members!!", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA" - * } - */ - ForumTopicSummary: { - /** @description The ID of the forum topic */ - id: number; - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Title - * - * @description The title of the forum topic - */ - title: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the forum topic was created at - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this forum topic (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the forum topic was updated at, if relevant - */ - updatedAt?: string; - /** - * Bumped at - * Format: date-time - * - * @description The ISO 8601 timestamp that the forum topic was bumped at. This timestamp is updated whenever there is any activity on the posts within the forum topic. - */ - bumpedAt?: string; - /** - * Is pinned - * - * @default false - */ - isPinned?: boolean; - /** - * Is locked - * - * @default false - */ - isLocked?: boolean; - }; - /** - * @example { - * "id": "00000000-0000-0000-0000-000000000000", - * "serverId": "wlVr3Ggl", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "message": "Remember to say hello **world**!", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA", - * "note": { - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA", - * "content": "Duly noted" - * } - * } - */ - ListItem: { - /** - * Format: uuid - * - * @description The ID of the list item - */ - id: string; - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Message - * Format: markdown - * - * @description The message of the list item - */ - message: string; - mentions?: components["schemas"]["Mentions"]; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the list item was created at - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this list item (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * Created by Webhook ID - * - * @description The ID of the webhook who created this list item, if it was created by a webhook - */ - createdByWebhookId?: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the list item was updated at, if relevant - */ - updatedAt?: string; - /** - * Updated by - * - * @description The ID of the user who updated this list item - */ - updatedBy?: string; - /** - * Format: uuid - * - * @description The ID of the parent list item if this list item is nested - */ - parentListItemId?: string; - /** - * Completed at - * Format: date-time - * - * @description The ISO 8601 timestamp that the list item was completed at - */ - completedAt?: string; - /** - * Completed by - * - * @description The ID of the user who completed this list item - */ - completedBy?: string; - note?: { - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the note was created at. If this field is populated, then there's a note associated with the list item - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this note - */ - createdBy: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the note was updated at, if relevant - */ - updatedAt?: string; - /** - * Updated by - * - * @description The ID of the user who updated this note - */ - updatedBy?: string; - mentions?: components["schemas"]["Mentions"]; - /** - * Note - * Format: markdown - * - * @description The note of the list item - */ - content: string; - }; - }; - /** - * @example { - * "id": "00000000-0000-0000-0000-000000000000", - * "serverId": "wlVr3Ggl", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "message": "Remember to say hello **world**!", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA", - * "note": { - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA" - * } - * } - */ - ListItemSummary: { - /** - * Format: uuid - * - * @description The ID of the list item - */ - id: string; - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Message - * Format: markdown - * - * @description The message of the list item - */ - message: string; - mentions?: components["schemas"]["Mentions"]; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the list item was created at - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this list item (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * Created by Webhook ID - * - * @description The ID of the webhook who created this list item, if it was created by a webhook - */ - createdByWebhookId?: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the list item was updated at, if relevant - */ - updatedAt?: string; - /** - * Updated by - * - * @description The ID of the user who updated this list item - */ - updatedBy?: string; - /** - * Format: uuid - * - * @description The ID of the parent list item if this list item is nested - */ - parentListItemId?: string; - /** - * Completed at - * Format: date-time - * - * @description The ISO 8601 timestamp that the list item was completed at - */ - completedAt?: string; - /** - * Completed by - * - * @description The ID of the user who completed this list item - */ - completedBy?: string; - note?: { - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the note was created at. If this field is populated, then there's a note associated with the list item - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this note - */ - createdBy: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the note was updated at, if relevant - */ - updatedAt?: string; - /** - * Updated by - * - * @description The ID of the user who updated this note - */ - updatedBy?: string; - }; - }; - /** - * @example { - * "id": 0, - * "serverId": "wlVr3Ggl", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "title": "HOW-TO: Smoke These Meats with Sweet Baby Ray's", - * "content": "Spicy jalapeno bacon ipsum dolor amet sirloin ground round short loin, meatball brisket capicola tri-tip ham pork belly biltong corned beef chuck. Chicken ham brisket shank rump buffalo t-bone. Short loin sausage buffalo porchetta pork belly rump tri-tip frankfurter tail pork chop cow sirloin. Pancetta porchetta tail ball tip chislic beef ribs. Buffalo andouille leberkas jerky. Fatback shankle andouille beef. Cow kielbasa buffalo pork loin chislic meatloaf short loin rump meatball prosciutto.", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA", - * "updatedAt": "2021-07-15T22:20:00.706Z", - * "updatedBy": "Ann6LewA" - * } - */ - Doc: { - /** - * Doc ID - * - * @description The ID of the doc - */ - id: number; - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Title - * - * @description The title of the doc - */ - title: string; - /** - * Content - * Format: markdown - * - * @description The content of the doc - */ - content: string; - mentions?: components["schemas"]["Mentions"]; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the doc was created at - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this doc - */ - createdBy: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the doc was updated at, if relevant - */ - updatedAt?: string; - /** - * Updated by - * - * @description The ID of the user who updated this doc - */ - updatedBy?: string; - }; - /** - * @example { - * "id": 123456, - * "content": "Wow, cool document!!!", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "docId": 0, - * "createdBy": "Ann6LewA" - * } - */ - DocComment: { - /** - * Doc comment ID - * - * @description The ID of the doc comment - */ - id: number; - /** - * Content - * Format: markdown - * - * @description The content of the doc comment - */ - content: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the doc comment was created at - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this doc comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the doc comment was updated at, if relevant - */ - updatedAt?: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Doc ID - * - * @description The ID of the doc - */ - docId: number; - mentions?: components["schemas"]["Mentions"]; - }; - /** - * @example { - * "channelId": "00000000-0000-0000-0000-000000000000", - * "createdBy": "Ann6LewA", - * "emote": { - * "id": 90000000, - * "name": "grinning", - * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" - * }, - * "docId": 0 - * } - */ - DocReaction: { - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * User ID - * - * @description The ID of the user who added the reaction - */ - createdBy: string; - emote: components["schemas"]["Emote"]; - /** - * Doc ID - * - * @description The ID of the doc - */ - docId: number; - }; - /** - * @example { - * "channelId": "00000000-0000-0000-0000-000000000000", - * "createdBy": "Ann6LewA", - * "emote": { - * "id": 90000000, - * "name": "grinning", - * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" - * }, - * "docId": 0, - * "docCommentId": 123456 - * } - */ - DocCommentReaction: { - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * User ID - * - * @description The ID of the user who added the reaction - */ - createdBy: string; - emote: components["schemas"]["Emote"]; - /** - * Doc ID - * - * @description The ID of the doc - */ - docId: number; - /** - * Doc comment ID - * - * @description The ID of the doc comment - */ - docCommentId: number; - }; - /** - * @example { - * "user": { - * "id": "Ann6LewA", - * "type": "user", - * "name": "Leopold Stotch", - * "createdAt": "2021-06-15T20:15:00.706Z" - * }, - * "roleIds": [], - * "nickname": "Professor Chaos", - * "joinedAt": "2021-07-15T20:15:00.706Z" - * } - */ - ServerMember: { - user: components["schemas"]["User"]; - /** Role IDs */ - roleIds: number[]; - /** Nickname */ - nickname?: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the member was created at - */ - joinedAt: string; - /** - * Is owner - * - * @default false - */ - isOwner?: boolean; - }; - /** - * @example { - * "user": { - * "id": "Ann6LewA", - * "type": "user", - * "name": "Leopold Stotch" - * }, - * "roleIds": [] - * } - */ - ServerMemberSummary: { - user: components["schemas"]["UserSummary"]; - /** Role IDs */ - roleIds: number[]; - }; - /** - * @example { - * "id": "Ann6LewA", - * "type": "user", - * "name": "Leopold Stotch", - * "createdAt": "2021-06-15T20:15:00.706Z" - * } - */ - User: { - /** - * User ID - * - * @description The ID of the user - */ - id: string; - /** - * User type - * - * @description The type of user. If this property is absent, it can assumed to be of type `user` - * @enum {string} - */ - type?: "bot" | "user"; - /** - * User name - * - * @description The user's name - */ - name: string; - /** - * Avatar - * Format: media-uri - * - * @description The avatar image associated with the user - */ - avatar?: string; - /** - * Banner - * Format: media-uri - * - * @description The banner image associated with the user - */ - banner?: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the user was created at - */ - createdAt: string; - }; - /** - * @example { - * "id": "Ann6LewA", - * "type": "user", - * "name": "Leopold Stotch" - * } - */ - UserSummary: { - /** - * User ID - * - * @description The ID of the user - */ - id: string; - /** - * User type - * - * @description The type of user. If this property is absent, it can assumed to be of type `user` - * @enum {string} - */ - type?: "bot" | "user"; - /** - * User name - * - * @description The user's name - */ - name: string; - /** - * Avatar - * Format: media-uri - * - * @description The avatar image associated with the user - */ - avatar?: string; - }; - /** - * @example { - * "user": { - * "id": "Ann6LewA", - * "type": "user", - * "name": "Leopold Stotch" - * }, - * "reason": "More toxic than a poison Pokémon", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA" - * } - */ - ServerMemberBan: { - user: components["schemas"]["UserSummary"]; - /** - * Reason - * - * @description The reason for the ban as submitted by the banner - */ - reason?: string; - /** - * Created by - * - * @description The ID of the user who created this server member ban - */ - createdBy: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the server member ban was created at - */ - createdAt: string; - }; - /** - * @example { - * "id": "00000000-0000-0000-0000-000000000000", - * "type": "chat", - * "name": "The Dank Cellar", - * "topic": "Dank memes ONLY", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA", - * "serverId": "wlVr3Ggl", - * "groupId": "ZVzBo83p" - * } - */ - ServerChannel: { - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - id: string; - /** - * @description The type of channel. This will determine what routes to use for creating content in a channel. For example, if this "chat", then one must use the routes for creating channel messages - * @enum {string} - */ - type: "announcements" | "calendar" | "chat" | "docs" | "forums" | "list" | "media" | "scheduling" | "stream" | "voice"; - /** @description The name of the channel */ - name: string; - /** @description The topic of the channel */ - topic?: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the channel was created at - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this channel - */ - createdBy: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the channel was updated at, if relevant - */ - updatedAt?: string; - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Channel ID - * Format: uuid - * - * @description ID of the parent channel or parent thread, if present. Only relevant for server channels - */ - parentId?: string; - /** @description Only relevant for server channels */ - categoryId?: number; - /** - * Group ID - * - * @description The ID of the group - */ - groupId: string; - /** - * Is public - * - * @description Whether the channel can be accessed from users who are not member of the server - * @default false - */ - isPublic?: boolean; - /** - * Archived by - * - * @description The ID of the user who archived this channel - */ - archivedBy?: string; - /** - * Archived at - * Format: date-time - * - * @description The ISO 8601 timestamp that the channel was archived at, if relevant - */ - archivedAt?: string; - }; - /** - * @example { - * "id": "wlVr3Ggl", - * "type": "community", - * "name": "Guilded", - * "url": "Guilded-Official", - * "about": "The Official Guilded Server! For devs, friends, and fans alike!", - * "ownerId": "Ann6LewA", - * "createdAt": "2018-10-05T20:15:00.706Z", - * "isVerified": true, - * "timezone": "America/Los Angeles (PST/PDT)" - * } - */ - Server: { - /** - * Server ID - * - * @description The ID of the server - */ - id: string; - /** - * Created by - * - * @description The ID of the user who created this server - */ - ownerId: string; - /** - * Server type - * - * @description The type of server designated from the server's settings page - * @enum {string} - */ - type?: "clan" | "community" | "friends" | "guild" | "organization" | "other" | "streaming" | "team"; - /** - * Server name - * - * @description The name given to the server - */ - name: string; - /** - * Server URL - * - * @description The URL that the server can be accessible from. For example, a value of "Guilded-Official" means the server can be accessible from https://www.guilded.gg/Guilded-Official - */ - url?: string; - /** - * Description - * - * @description The description associated with the server - */ - about?: string; - /** - * Avatar - * Format: media-uri - * - * @description The avatar image associated with the server - */ - avatar?: string; - /** - * Banner - * Format: media-uri - * - * @description The banner image associated with the server - */ - banner?: string; - /** - * Timezone - * - * @description The timezone associated with the server - */ - timezone?: string; - /** - * Is verified - * - * @description The verified status of the server - */ - isVerified?: boolean; - /** - * Channel ID - * Format: uuid - * - * @description The channel ID of the default channel of the server. This channel is defined as the first chat or voice channel in the left sidebar of a server in our UI. This channel is useful for sending welcome messages, though note that a bot may not have permissions to interact with this channel depending on how the server is configured. - */ - defaultChannelId?: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the server was created at - */ - createdAt: string; - }; - /** - * @example { - * "id": "00000000-0000-0000-0000-000000000000", - * "serverId": "wlVr3Ggl", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "name": "E-102 Gamma", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA" - * } - */ - Webhook: { - /** - * Webhook ID - * Format: uuid - * - * @description The ID of the webhook - */ - id: string; - /** - * Name - * - * @description The name of the webhook - */ - name: string; - /** - * Avatar - * Format: media-uri - * - * @description The avatar image associated with the webhook - */ - avatar?: string; - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the webhook was created at - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this webhook - */ - createdBy: string; - /** - * Deleted at - * Format: date-time - * - * @description The ISO 8601 timestamp that the webhook was deleted at - */ - deletedAt?: string; - /** - * Token - * - * @description The token of the webhook - */ - token?: string; - }; - /** - * @example { - * "id": 1, - * "serverId": "wlVr3Ggl", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "name": "Surprise LAN party for my wife 🤫", - * "description": "**Don't say anything to her!** She's gonna love playing Call of Duty all night", - * "location": "My house!", - * "url": "https://www.surprisepartygame.com/", - * "duration": 60, - * "color": 16106496, - * "startsAt": "2022-06-16T00:00:00.000Z", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA" - * } - */ - CalendarEvent: { - /** - * Calendar event ID - * - * @description The ID of the calendar event - */ - id: number; - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Name - * - * @description The name of the event - */ - name: string; - /** - * Description - * Format: markdown - * - * @description The description of the event - */ - description?: string; - /** - * Location - * - * @description The location of the event - */ - location?: string; - /** - * Format: uri - * - * @description A URL to associate with the event - */ - url?: string; - /** @description The color of the event when viewing in the calendar */ - color?: number; - /** @description Is this event a repeating event */ - repeats?: boolean; - /** - * Calendar event series ID - * Format: uuid - * - * @description The ID of the calendar event series. Only shows if the event is repeating - */ - seriesId?: string; - /** - * Role IDs - * - * @description The role IDs to restrict the event to - */ - roleIds?: number[]; - /** - * RSVP disabled - * - * @description When disabled, users will not be able to RSVP to the event - */ - rsvpDisabled?: boolean; - /** - * Is all day - * - * @description Does the event last all day - */ - isAllDay?: boolean; - /** @description The number of RSVPs to allow before waitlisting RSVPs */ - rsvpLimit?: number; - /** @description When `rsvpLimit` is set, users from the waitlist will be added as space becomes available in the event */ - autofillWaitlist?: boolean; - /** - * Starts at - * Format: date-time - * - * @description The ISO 8601 timestamp that the event starts at - */ - startsAt: string; - /** - * Duration - * - * @description The duration of the event _**in minutes**_ - */ - duration?: number; - /** Is private */ - isPrivate?: boolean; - mentions?: components["schemas"]["Mentions"]; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the event was created at - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this event - */ - createdBy: string; - cancellation?: { - /** - * Description - * Format: markdown - * - * @description The description of event cancellation - */ - description?: string; - /** - * Created by - * - * @description The ID of the user who created this event cancellation - */ - createdBy: string; - }; - }; - /** - * @example { - * "id": 90000000, - * "name": "grinning", - * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" - * } - */ - Emote: { - /** - * Emote ID - * - * @description The ID of the emote - */ - id: number; - /** - * Name - * - * @description The name of the emote - */ - name: string; - /** - * Emote URL - * Format: media-uri - * - * @description The URL of the emote image - */ - url: string; - /** - * Server ID - * - * @description The ID of the server the emote was created on - */ - serverId?: string; - }; - /** - * @example { - * "calendarEventId": 1, - * "channelId": "00000000-0000-0000-0000-000000000000", - * "serverId": "wlVr3Ggl", - * "userId": "Ann6LewA", - * "status": "going", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA" - * } - */ - CalendarEventRsvp: { - /** - * Calendar event ID - * - * @description The ID of the calendar event - */ - calendarEventId: number; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * User ID - * - * @description The ID of the user - */ - userId: string; - /** - * Status - * - * @description The status of the RSVP - * @enum {string} - */ - status: "declined" | "going" | "invited" | "maybe" | "not responded" | "waitlisted"; - /** - * Created by - * - * @description The ID of the user who created this RSVP - */ - createdBy: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the RSVP was created at - */ - createdAt: string; - /** - * Updated by - * - * @description The ID of the user who updated this RSVP - */ - updatedBy?: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the RSVP was updated at, if relevant - */ - updatedAt?: string; - }; - /** - * @example { - * "id": 1234567890, - * "content": "I will be there!!", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "createdAt": "2022-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA", - * "calendarEventId": 987654321 - * } - */ - CalendarEventComment: { - /** - * Calendar event comment ID - * - * @description The ID of the calendar event comment - */ - id: number; - /** - * Content - * Format: markdown - * - * @description The content of the calendar event comment - */ - content: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the calendar event comment was created at - */ - createdAt: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the calendar event comment was updated at, if relevant - */ - updatedAt?: string; - /** - * Calendar event ID - * - * @description The ID of the calendar event - */ - calendarEventId: number; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Created by - * - * @description The ID of the user who created this calendar event comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - mentions?: components["schemas"]["Mentions"]; - }; - /** - * @example { - * "channelId": "00000000-0000-0000-0000-000000000000", - * "createdBy": "Ann6LewA", - * "emote": { - * "id": 90000000, - * "name": "grinning", - * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" - * }, - * "calendarEventId": 1 - * } - */ - CalendarEventReaction: { - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * User ID - * - * @description The ID of the user who added the reaction - */ - createdBy: string; - emote: components["schemas"]["Emote"]; - /** - * Calendar event ID - * - * @description The ID of the calendar event - */ - calendarEventId: number; - }; - /** - * @example { - * "channelId": "00000000-0000-0000-0000-000000000000", - * "createdBy": "Ann6LewA", - * "emote": { - * "id": 90000000, - * "name": "grinning", - * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" - * }, - * "calendarEventId": 1, - * "calendarEventCommentId": 1234567890 - * } - */ - CalendarEventCommentReaction: { - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * User ID - * - * @description The ID of the user who added the reaction - */ - createdBy: string; - emote: components["schemas"]["Emote"]; - /** - * Calendar event ID - * - * @description The ID of the calendar event - */ - calendarEventId: number; - /** - * Calendar event comment ID - * - * @description The ID of the calendar event comment - */ - calendarEventCommentId: number; - }; - /** - * @example { - * "id": "00000000-0000-0000-0000-000000000000", - * "serverId": "wlVr3Ggl", - * "channelId": "00000000-0000-0000-0000-000000000000" - * } - */ - CalendarEventSeries: { - /** - * Calendar event series ID - * Format: uuid - * - * @description The ID of the calendar event series - */ - id: string; - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - }; - /** - * @example { - * "id": "9RVMoDZy", - * "serverId": "wlVr3Ggl", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "createdAt": "2021-06-15T20:15:00.706Z", - * "createdBy": "Ann6LewA", - * "title": "Pizza Party, don't be tardy!", - * "content": "Grab a slice, don't be slow, At our pizza party, it's the way to go! Toppings galore, cheesy delight, Come join us, it'll be out of sight!" - * } - */ - Announcement: { - /** - * Announcement ID - * - * @description The ID of the announcement - */ - id: string; - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the announcement was created at - */ - createdAt: string; - /** - * Created by - * - * @description The ID of the user who created this announcement - */ - createdBy: string; - /** - * Content - * Format: markdown - * - * @description The content of the announcement - */ - content: string; - mentions?: components["schemas"]["Mentions"]; - /** - * Title - * - * @description The title of the announcement - */ - title: string; - }; - /** - * @example { - * "channelId": "00000000-0000-0000-0000-000000000000", - * "createdBy": "Ann6LewA", - * "emote": { - * "id": 90000000, - * "name": "grinning", - * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" - * }, - * "announcementId": "9RVMoDZy" - * } - */ - AnnouncementReaction: { - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * User ID - * - * @description The ID of the user who added the reaction - */ - createdBy: string; - emote: components["schemas"]["Emote"]; - /** - * Announcement ID - * - * @description The ID of the announcement - */ - announcementId: string; - }; - /** - * @example { - * "id": 123456, - * "content": "Now THAT is one awesome announcement!!!", - * "createdAt": "2023-04-07T16:19:00.000Z", - * "channelId": "00000000-0000-0000-0000-000000000000", - * "announcementId": "9RVMoDZy", - * "createdBy": "Ann6LewA" - * } - */ - AnnouncementComment: { - /** - * Announcement comment ID - * - * @description The ID of the announcement comment - */ - id: number; - /** - * Content - * Format: markdown - * - * @description The content of the announcement comment - */ - content: string; - /** - * Created at - * Format: date-time - * - * @description The ISO 8601 timestamp that the announcement comment was created at - */ - createdAt: string; - /** - * Updated at - * Format: date-time - * - * @description The ISO 8601 timestamp that the announcement comment was updated at, if relevant - */ - updatedAt?: string; - /** - * Created by - * - * @description The ID of the user who created this announcement comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Announcement ID - * - * @description The ID of the announcement - */ - announcementId: string; - mentions?: components["schemas"]["Mentions"]; - }; - /** - * @example { - * "channelId": "00000000-0000-0000-0000-000000000000", - * "createdBy": "Ann6LewA", - * "emote": { - * "id": 90000000, - * "name": "grinning", - * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" - * }, - * "announcementId": "9RVMoDZy", - * "announcementCommentId": 123456 - * } - */ - AnnouncementCommentReaction: { - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * User ID - * - * @description The ID of the user who added the reaction - */ - createdBy: string; - emote: components["schemas"]["Emote"]; - /** - * Announcement ID - * - * @description The ID of the announcement - */ - announcementId: string; - /** - * Announcement comment ID - * - * @description The ID of the announcement comment - */ - announcementCommentId: number; - }; - }; - responses: { - _WelcomeMessage: { - content: { - "application/json": { - /** @description The interval in milliseconds that your bot should be configured to send ping frames for the bot's [heartbeat](/docs/api/heartbeat) to be considered valid. */ - heartbeatIntervalMs: number; - /** @description The last message's ID that was sent to this bot. See [event replay](/docs/api/replay) for more details */ - lastMessageId: string; - /** - * Bot ID - * Format: uuid - * - * @description The ID of the bot - */ - botId: string; - user: components["schemas"]["User"]; - }; - }; - }; - /** @description Emitted when a bot is added to a server */ - BotServerMembershipCreated: { - content: { - "application/json": { - server: components["schemas"]["Server"]; - /** - * Created by - * - * @description The ID of the user who created this server membership - */ - createdBy: string; - }; - }; - }; - /** @description Emitted when a bot is removed from a server */ - BotServerMembershipDeleted: { - content: { - "application/json": { - server: components["schemas"]["Server"]; - /** - * Deleted by - * - * @description The ID of the user who deleted this server membership - */ - deletedBy: string; - }; - }; - }; - ChatMessageCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - message: components["schemas"]["ChatMessage"]; - }; - }; - }; - ChatMessageUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - message: components["schemas"]["ChatMessage"]; - }; - }; - }; - ChatMessageDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - message: { - /** - * Message ID - * Format: uuid - * - * @description The ID of the message - */ - id: string; - /** - * Server ID - * - * @description The ID of the server - */ - serverId?: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Deleted at - * Format: date-time - * - * @description The ISO 8601 timestamp that the message was deleted at - */ - deletedAt: string; - /** Is private */ - isPrivate?: boolean; - }; - }; - }; - }; - ServerMemberJoined: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - member: components["schemas"]["ServerMember"]; - }; - }; - }; - ServerMemberRemoved: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * User ID - * - * @description The ID of the user - */ - userId: string; - /** - * Is kick? - * - * @description If this member leaving was the result of a kick - */ - isKick?: boolean; - /** - * Is ban? - * - * @description If this member leaving was the result of a ban - */ - isBan?: boolean; - }; - }; - }; - ServerMemberBanned: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - serverMemberBan: components["schemas"]["ServerMemberBan"]; - }; - }; - }; - ServerMemberUnbanned: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - serverMemberBan: components["schemas"]["ServerMemberBan"]; - }; - }; - }; - ServerMemberUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - userInfo: { - /** - * User ID - * - * @description The ID of the user - */ - id: string; - /** - * Nickname - * - * @description The nickname that was just updated for the user - */ - nickname?: string | null; - }; - }; - }; - }; - ServerRolesUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - memberRoleIds: { - /** - * User ID - * - * @description The ID of the member that had roles updated - */ - userId: string; - /** - * Role IDs - * - * @description The IDs of the roles that the member currently has _after_ this operation - */ - roleIds: number[]; - }[]; - }; - }; - }; - ServerChannelCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - channel: components["schemas"]["ServerChannel"]; - }; - }; - }; - ServerChannelUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - channel: components["schemas"]["ServerChannel"]; - }; - }; - }; - ServerChannelDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - channel: components["schemas"]["ServerChannel"]; - }; - }; - }; - ServerMemberSocialLinkCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - socialLink: components["schemas"]["SocialLink"]; - }; - }; - }; - ServerMemberSocialLinkUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - socialLink: components["schemas"]["SocialLink"]; - }; - }; - }; - ServerMemberSocialLinkDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - socialLink: components["schemas"]["SocialLink"]; - }; - }; - }; - ServerWebhookCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - webhook: components["schemas"]["Webhook"]; - }; - }; - }; - ServerWebhookUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - webhook: components["schemas"]["Webhook"]; - }; - }; - }; - DocCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - doc: components["schemas"]["Doc"]; - }; - }; - }; - DocUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - doc: components["schemas"]["Doc"]; - }; - }; - }; - DocDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - doc: components["schemas"]["Doc"]; - }; - }; - }; - DocCommentCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - docComment: components["schemas"]["DocComment"]; - }; - }; - }; - DocCommentDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - docComment: components["schemas"]["DocComment"]; - }; - }; - }; - DocCommentUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - docComment: components["schemas"]["DocComment"]; - }; - }; - }; - CalendarEventCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - calendarEvent: components["schemas"]["CalendarEvent"]; - }; - }; - }; - CalendarEventUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - calendarEvent: components["schemas"]["CalendarEvent"]; - }; - }; - }; - CalendarEventDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - calendarEvent: components["schemas"]["CalendarEvent"]; - }; - }; - }; - ForumTopicCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - forumTopic: components["schemas"]["ForumTopic"]; - }; - }; - }; - ForumTopicUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - forumTopic: components["schemas"]["ForumTopic"]; - }; - }; - }; - ForumTopicDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - forumTopic: components["schemas"]["ForumTopic"]; - }; - }; - }; - ForumTopicPinned: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - forumTopic: components["schemas"]["ForumTopic"]; - }; - }; - }; - ForumTopicUnpinned: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - forumTopic: components["schemas"]["ForumTopic"]; - }; - }; - }; - ForumTopicReactionCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["ForumTopicReaction"]; - }; - }; - }; - ForumTopicReactionDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["ForumTopicReaction"]; - }; - }; - }; - ForumTopicLocked: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - forumTopic: components["schemas"]["ForumTopic"]; - }; - }; - }; - ForumTopicUnlocked: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - forumTopic: components["schemas"]["ForumTopic"]; - }; - }; - }; - ForumTopicCommentCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - forumTopicComment: components["schemas"]["ForumTopicComment"]; - }; - }; - }; - ForumTopicCommentUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - forumTopicComment: components["schemas"]["ForumTopicComment"]; - }; - }; - }; - ForumTopicCommentDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - forumTopicComment: components["schemas"]["ForumTopicComment"]; - }; - }; - }; - CalendarEventRsvpUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - calendarEventRsvp: components["schemas"]["CalendarEventRsvp"]; - }; - }; - }; - CalendarEventRsvpManyUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - calendarEventRsvps: components["schemas"]["CalendarEventRsvp"][]; - }; - }; - }; - CalendarEventRsvpDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - calendarEventRsvp: components["schemas"]["CalendarEventRsvp"]; - }; - }; - }; - ListItemCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - listItem: components["schemas"]["ListItem"]; - }; - }; - }; - ListItemUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - listItem: components["schemas"]["ListItem"]; - }; - }; - }; - ListItemDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - listItem: components["schemas"]["ListItem"]; - }; - }; - }; - ListItemCompleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - listItem: components["schemas"]["ListItem"]; - }; - }; - }; - ListItemUncompleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - listItem: components["schemas"]["ListItem"]; - }; - }; - }; - ChannelMessageReactionCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["ChatMessageReaction"]; - }; - }; - }; - ChannelMessageReactionDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Deleted by - * - * @description The ID of the user who deleted this reaction - */ - deletedBy: string; - reaction: components["schemas"]["ChatMessageReaction"]; - }; - }; - }; - ChannelMessageReactionManyDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - /** - * Channel ID - * Format: uuid - * - * @description The ID of the channel - */ - channelId: string; - /** - * Message ID - * Format: uuid - * - * @description The ID of the message - */ - messageId: string; - /** - * Deleted by - * - * @description The ID of the user who deleted this reaction - */ - deletedBy: string; - /** @description The count of reactions that were removed */ - count: number; - /** @description If present, only reactions of this emote were bulk removed from the message */ - emote?: components["schemas"]["Emote"]; - }; - }; - }; - ForumTopicCommentReactionCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["ForumTopicCommentReaction"]; - }; - }; - }; - ForumTopicCommentReactionDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["ForumTopicCommentReaction"]; - }; - }; - }; - CalendarEventCommentCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - calendarEventComment: components["schemas"]["CalendarEventComment"]; - }; - }; - }; - CalendarEventCommentDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - calendarEventComment: components["schemas"]["CalendarEventComment"]; - }; - }; - }; - CalendarEventCommentUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - calendarEventComment: components["schemas"]["CalendarEventComment"]; - }; - }; - }; - CalendarEventReactionCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["CalendarEventReaction"]; - }; - }; - }; - CalendarEventReactionDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["CalendarEventReaction"]; - }; - }; - }; - CalendarEventCommentReactionCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["CalendarEventCommentReaction"]; - }; - }; - }; - CalendarEventCommentReactionDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["CalendarEventCommentReaction"]; - }; - }; - }; - DocReactionCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["DocReaction"]; - }; - }; - }; - DocReactionDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["DocReaction"]; - }; - }; - }; - DocCommentReactionCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["DocCommentReaction"]; - }; - }; - }; - DocCommentReactionDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["DocCommentReaction"]; - }; - }; - }; - CalendarEventSeriesUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - calendarEventSeries: components["schemas"]["CalendarEventSeries"]; - /** - * Calendar event ID - * - * @description The calendar event updates started at - */ - calendarEventId?: number; - }; - }; - }; - CalendarEventSeriesDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - calendarEventSeries: components["schemas"]["CalendarEventSeries"]; - /** - * Calendar event ID - * - * @description The calendar event deletions started at - */ - calendarEventId?: number; - }; - }; - }; - AnnouncementCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - announcement: components["schemas"]["Announcement"]; - }; - }; - }; - AnnouncementUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - announcement: components["schemas"]["Announcement"]; - }; - }; - }; - AnnouncementDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - announcement: components["schemas"]["Announcement"]; - }; - }; - }; - AnnouncementReactionCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["AnnouncementReaction"]; - }; - }; - }; - AnnouncementReactionDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["AnnouncementReaction"]; - }; - }; - }; - AnnouncementCommentCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - announcementComment: components["schemas"]["AnnouncementComment"]; - }; - }; - }; - AnnouncementCommentUpdated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - announcementComment: components["schemas"]["AnnouncementComment"]; - }; - }; - }; - AnnouncementCommentDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - announcementComment: components["schemas"]["AnnouncementComment"]; - }; - }; - }; - AnnouncementCommentReactionCreated: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["AnnouncementCommentReaction"]; - }; - }; - }; - AnnouncementCommentReactionDeleted: { - content: { - "application/json": { - /** - * Server ID - * - * @description The ID of the server - */ - serverId: string; - reaction: components["schemas"]["AnnouncementCommentReaction"]; - }; - }; - }; - }; - parameters: never; - requestBodies: never; - headers: never; - pathItems: never; + schemas: { + _SocketEventEnvelope: { + /** + * Opcode + * + * @description An operation code corresponding to the nature of the sent message (for example, success, failure, etc.) + * @enum {integer} + */ + op: + | 0 + | 1 + | 2 + | 8 + | 9; + /** + * Data + * + * @description Data of any form depending on the underlying event + */ + d?: Record< + string, + never + >; + /** + * Message ID + * + * @description Message ID used for replaying events after a disconnect + */ + s?: string; + /** + * Event name + * + * @description Event name for the given message + */ + t?: string; + }; + /** + * @example { + * "id": "00000000-0000-0000-0000-000000000000", + * "type": "default", + * "serverId": "wlVr3Ggl", + * "groupId": "ZVzBo83p", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "content": "Hello **world**!", + * "embeds": [ + * { + * "title": "embed title", + * "description": "embeds support a **different** __subset__ *of* markdown than other markdown fields. <@Ann6LewA>\n\n [links](https://www.guilded.gg) ```\ncheck this code out```\n\n:pizza: time!! ttyl", + * "url": "https://www.guilded.gg", + * "color": 6118369, + * "timestamp": "2022-04-12T22:14:36.737Z", + * "footer": { + * "icon_url": "https://www.guilded.gg/asset/Logos/logomark/Color/Guilded_Logomark_Color.png", + * "text": "footer text" + * }, + * "thumbnail": { + * "url": "https://www.guilded.gg/asset/Logos/logomark/Color/Guilded_Logomark_Color.png" + * }, + * "image": { + * "url": "https://www.guilded.gg/asset/Logos/logomark_wordmark/Color/Guilded_Logomark_Wordmark_Color.png" + * }, + * "author": { + * "name": "Gil", + * "url": "https://www.guilded.gg", + * "icon_url": "https://www.guilded.gg/asset/Default/Gil-md.png" + * }, + * "fields": [ + * { + * "name": "hello", + * "value": "these are fields" + * }, + * { + * "name": "~~help i have been crossed out~~", + * "value": "~~oh noes~~", + * "inline": true + * }, + * { + * "name": "another inline", + * "value": "field", + * "inline": true + * } + * ] + * } + * ], + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA" + * } + */ + ChatMessage: { + /** + * Message ID + * Format: uuid + * + * @description The ID of the message + */ + id: string; + /** + * Type + * + * @description The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated. + * @enum {string} + */ + type: + | "default" + | "system"; + /** + * Server ID + * + * @description The ID of the server + */ + serverId?: string; + /** + * Group ID + * + * @description The ID of the group + */ + groupId?: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Content + * Format: markdown + * + * @description The content of the message + */ + content?: string; + embeds?: components["schemas"]["ChatEmbed"][]; + /** @description Message IDs that were replied to */ + replyMessageIds?: string[]; + /** + * Is private + * + * @description If set, this message will only be seen by those mentioned or replied to + */ + isPrivate?: boolean; + /** + * Is silent + * + * @description If set, this message did not notify mention or reply recipients + * @default false + */ + isSilent?: boolean; + mentions?: components["schemas"]["Mentions"]; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the message was created at + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this message (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * Created by Webhook ID + * + * @description The ID of the webhook who created this message, if it was created by a webhook + */ + createdByWebhookId?: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the message was updated at, if relevant + */ + updatedAt?: string; + }; + /** + * @example { + * "channelId": "00000000-0000-0000-0000-000000000000", + * "createdBy": "Ann6LewA", + * "emote": { + * "id": 90000000, + * "name": "grinning", + * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" + * }, + * "messageId": "00000000-0000-0000-0000-000000000000" + * } + */ + ChatMessageReaction: { + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * User ID + * + * @description The ID of the user who added the reaction + */ + createdBy: string; + emote: components["schemas"]["Emote"]; + /** + * Message ID + * Format: uuid + * + * @description The ID of the message + */ + messageId: string; + }; + /** + * @description Rich content sections optionally associated with chat messages. Properties with "webhook-markdown" support allow for the following: link, italic, bold, strikethrough, underline, inline code, block code, reaction, and mention. + * @example { + * "title": "embed title", + * "description": "embeds support a **different** __subset__ *of* markdown than other markdown fields. <@Ann6LewA>\n\n [links](https://www.guilded.gg) ```\ncheck this code out```\n\n:pizza: time!! ttyl", + * "url": "https://www.guilded.gg", + * "color": 6118369, + * "timestamp": "2022-04-12T22:14:36.737Z", + * "footer": { + * "icon_url": "https://www.guilded.gg/asset/Logos/logomark/Color/Guilded_Logomark_Color.png", + * "text": "footer text" + * }, + * "thumbnail": { + * "url": "https://www.guilded.gg/asset/Logos/logomark/Color/Guilded_Logomark_Color.png" + * }, + * "image": { + * "url": "https://www.guilded.gg/asset/Logos/logomark_wordmark/Color/Guilded_Logomark_Wordmark_Color.png" + * }, + * "author": { + * "name": "Gil", + * "url": "https://www.guilded.gg", + * "icon_url": "https://www.guilded.gg/asset/Default/Gil-md.png" + * }, + * "fields": [ + * { + * "name": "hello", + * "value": "these are fields" + * }, + * { + * "name": "~~help i have been crossed out~~", + * "value": "~~oh noes~~", + * "inline": true + * }, + * { + * "name": "another inline", + * "value": "field", + * "inline": true + * } + * ] + * } + */ + ChatEmbed: { + /** + * Format: webhook-markdown + * + * @description Main header of the embed + */ + title?: string; + /** + * Format: webhook-markdown + * + * @description Subtext of the embed + */ + description?: string; + /** + * Format: uri + * + * @description URL to linkify the `title` field with + */ + url?: string; + /** @description Decimal value of the color that the left border should be */ + color?: number; + /** @description A small section at the bottom of the embed */ + footer?: { + /** + * Format: media-uri + * + * @description URL of a small image to put in the footer + */ + icon_url?: string; + /** @description Text of the footer */ + text: string; + }; + /** + * Format: date-time + * + * @description A timestamp to put in the footer + */ + timestamp?: string; + /** @description An image to the right of the embed's content */ + thumbnail?: { + /** + * Format: media-uri + * + * @description URL of the image + */ + url?: string; + }; + /** @description The main picture to associate with the embed */ + image?: { + /** + * Format: media-uri + * + * @description URL of the image + */ + url?: string; + }; + /** @description A small section above the title of the embed */ + author?: { + /** @description Name of the author */ + name?: string; + /** + * Format: uri + * + * @description URL to linkify the author's `name` field + */ + url?: string; + /** + * Format: media-uri + * + * @description URL of a small image to display to the left of the author's `name` + */ + icon_url?: string; + }; + /** @description Table-like cells to add to the embed */ + fields?: { + /** + * Format: webhook-markdown + * + * @description Header of the table-like cell + */ + name: string; + /** + * Format: webhook-markdown + * + * @description Subtext of the table-like cell + */ + value: string; + /** + * @description If the field should wrap or not + * @default false + */ + inline?: boolean; + }[]; + }; + /** + * @example { + * "type": "roblox", + * "userId": "Ann6LewA", + * "handle": "builderman", + * "serviceId": "156", + * "createdAt": "2006-03-08T20:15:00.706Z" + * } + */ + SocialLink: { + /** + * Social link type + * + * @description The type of social link that Guilded supports. Depending on this value, `handle` or `serviceId` may or may not be present + * @enum {string} + */ + type: + | "bnet" + | "epic" + | "facebook" + | "origin" + | "patreon" + | "psn" + | "roblox" + | "steam" + | "switch" + | "twitch" + | "twitter" + | "xbox" + | "youtube"; + /** + * User ID + * + * @description The ID of the user that the social link is associated with + */ + userId: string; + /** @description The handle of the user within the external service */ + handle?: string; + /** @description The unique ID that represents this member's social link within the external service */ + serviceId?: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the social link was created at + */ + createdAt: string; + }; + /** + * @description Metadata of who or what is mentioned in content + * @example { + * "users": [ + * { + * "id": "Ann6LewA" + * } + * ], + * "channels": [ + * { + * "id": "00000000-0000-0000-0000-000000000000" + * } + * ], + * "roles": [ + * { + * "id": 591232 + * } + * ], + * "everyone": true, + * "here": true + * } + */ + Mentions: { + /** + * Users + * + * @description Info on mentioned users + */ + users?: { + /** + * User ID + * + * @description The ID of the user + */ + id: string; + }[]; + /** + * Channels + * + * @description Info on mentioned channels + */ + channels?: { + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + id: string; + }[]; + /** + * Roles + * + * @description Info on mentioned roles + */ + roles?: { + /** + * Role ID + * + * @description The ID of the role + */ + id: number; + }[]; + /** + * Everyone + * + * @description If @everyone was mentioned + */ + everyone?: boolean; + /** + * Here + * + * @description If @here was mentioned + */ + here?: boolean; + }; + /** + * @example { + * "id": 1234567890, + * "content": "Great idea!", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "forumTopicId": 2036274747, + * "createdBy": "Ann6LewA" + * } + */ + ForumTopicComment: { + /** @description The ID of the forum topic comment */ + id: number; + /** + * Content + * Format: markdown + * + * @description The content of the forum topic comment + */ + content: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the forum topic comment was created at + */ + createdAt: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the forum topic comment was updated at, if relevant + */ + updatedAt?: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** @description The ID of the forum topic */ + forumTopicId: number; + /** + * Created by + * + * @description The ID of the user who created this forum topic comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + mentions?: components["schemas"]["Mentions"]; + }; + /** + * @example { + * "channelId": "00000000-0000-0000-0000-000000000000", + * "createdBy": "Ann6LewA", + * "emote": { + * "id": 90000000, + * "name": "grinning", + * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" + * }, + * "forumTopicId": 123456 + * } + */ + ForumTopicReaction: { + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * User ID + * + * @description The ID of the user who added the reaction + */ + createdBy: string; + emote: components["schemas"]["Emote"]; + /** @description The ID of the forum topic */ + forumTopicId: number; + }; + /** + * @example { + * "channelId": "00000000-0000-0000-0000-000000000000", + * "createdBy": "Ann6LewA", + * "emote": { + * "id": 90000000, + * "name": "grinning", + * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" + * }, + * "forumTopicId": 123456, + * "forumTopicCommentId": 1234567890 + * } + */ + ForumTopicCommentReaction: { + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * User ID + * + * @description The ID of the user who added the reaction + */ + createdBy: string; + emote: components["schemas"]["Emote"]; + /** @description The ID of the forum topic */ + forumTopicId: number; + /** @description The ID of the forum topic comment */ + forumTopicCommentId: number; + }; + /** + * @example { + * "id": 123456, + * "serverId": "wlVr3Ggl", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "title": "Welcome new members!!", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA", + * "content": "Please introduce yourself in this topic!!!" + * } + */ + ForumTopic: { + /** @description The ID of the forum topic */ + id: number; + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Title + * + * @description The title of the forum topic + */ + title: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the forum topic was created at + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this forum topic (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the forum topic was updated at, if relevant + */ + updatedAt?: string; + /** + * Bumped at + * Format: date-time + * + * @description The ISO 8601 timestamp that the forum topic was bumped at. This timestamp is updated whenever there is any activity on the posts within the forum topic. + */ + bumpedAt?: string; + /** + * Is pinned + * + * @default false + */ + isPinned?: boolean; + /** + * Is locked + * + * @default false + */ + isLocked?: boolean; + /** + * Content + * Format: markdown + * + * @description The content of the forum topic + */ + content: string; + mentions?: components["schemas"]["Mentions"]; + }; + /** + * @example { + * "id": 123456, + * "serverId": "wlVr3Ggl", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "title": "Welcome new members!!", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA" + * } + */ + ForumTopicSummary: { + /** @description The ID of the forum topic */ + id: number; + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Title + * + * @description The title of the forum topic + */ + title: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the forum topic was created at + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this forum topic (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the forum topic was updated at, if relevant + */ + updatedAt?: string; + /** + * Bumped at + * Format: date-time + * + * @description The ISO 8601 timestamp that the forum topic was bumped at. This timestamp is updated whenever there is any activity on the posts within the forum topic. + */ + bumpedAt?: string; + /** + * Is pinned + * + * @default false + */ + isPinned?: boolean; + /** + * Is locked + * + * @default false + */ + isLocked?: boolean; + }; + /** + * @example { + * "id": "00000000-0000-0000-0000-000000000000", + * "serverId": "wlVr3Ggl", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "message": "Remember to say hello **world**!", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA", + * "note": { + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA", + * "content": "Duly noted" + * } + * } + */ + ListItem: { + /** + * Format: uuid + * + * @description The ID of the list item + */ + id: string; + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Message + * Format: markdown + * + * @description The message of the list item + */ + message: string; + mentions?: components["schemas"]["Mentions"]; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the list item was created at + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this list item (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * Created by Webhook ID + * + * @description The ID of the webhook who created this list item, if it was created by a webhook + */ + createdByWebhookId?: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the list item was updated at, if relevant + */ + updatedAt?: string; + /** + * Updated by + * + * @description The ID of the user who updated this list item + */ + updatedBy?: string; + /** + * Format: uuid + * + * @description The ID of the parent list item if this list item is nested + */ + parentListItemId?: string; + /** + * Completed at + * Format: date-time + * + * @description The ISO 8601 timestamp that the list item was completed at + */ + completedAt?: string; + /** + * Completed by + * + * @description The ID of the user who completed this list item + */ + completedBy?: string; + note?: { + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the note was created at. If this field is populated, then there's a note associated with the list item + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this note + */ + createdBy: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the note was updated at, if relevant + */ + updatedAt?: string; + /** + * Updated by + * + * @description The ID of the user who updated this note + */ + updatedBy?: string; + mentions?: components["schemas"]["Mentions"]; + /** + * Note + * Format: markdown + * + * @description The note of the list item + */ + content: string; + }; + }; + /** + * @example { + * "id": "00000000-0000-0000-0000-000000000000", + * "serverId": "wlVr3Ggl", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "message": "Remember to say hello **world**!", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA", + * "note": { + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA" + * } + * } + */ + ListItemSummary: { + /** + * Format: uuid + * + * @description The ID of the list item + */ + id: string; + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Message + * Format: markdown + * + * @description The message of the list item + */ + message: string; + mentions?: components["schemas"]["Mentions"]; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the list item was created at + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this list item (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * Created by Webhook ID + * + * @description The ID of the webhook who created this list item, if it was created by a webhook + */ + createdByWebhookId?: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the list item was updated at, if relevant + */ + updatedAt?: string; + /** + * Updated by + * + * @description The ID of the user who updated this list item + */ + updatedBy?: string; + /** + * Format: uuid + * + * @description The ID of the parent list item if this list item is nested + */ + parentListItemId?: string; + /** + * Completed at + * Format: date-time + * + * @description The ISO 8601 timestamp that the list item was completed at + */ + completedAt?: string; + /** + * Completed by + * + * @description The ID of the user who completed this list item + */ + completedBy?: string; + note?: { + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the note was created at. If this field is populated, then there's a note associated with the list item + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this note + */ + createdBy: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the note was updated at, if relevant + */ + updatedAt?: string; + /** + * Updated by + * + * @description The ID of the user who updated this note + */ + updatedBy?: string; + }; + }; + /** + * @example { + * "id": 0, + * "serverId": "wlVr3Ggl", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "title": "HOW-TO: Smoke These Meats with Sweet Baby Ray's", + * "content": "Spicy jalapeno bacon ipsum dolor amet sirloin ground round short loin, meatball brisket capicola tri-tip ham pork belly biltong corned beef chuck. Chicken ham brisket shank rump buffalo t-bone. Short loin sausage buffalo porchetta pork belly rump tri-tip frankfurter tail pork chop cow sirloin. Pancetta porchetta tail ball tip chislic beef ribs. Buffalo andouille leberkas jerky. Fatback shankle andouille beef. Cow kielbasa buffalo pork loin chislic meatloaf short loin rump meatball prosciutto.", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA", + * "updatedAt": "2021-07-15T22:20:00.706Z", + * "updatedBy": "Ann6LewA" + * } + */ + Doc: { + /** + * Doc ID + * + * @description The ID of the doc + */ + id: number; + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Title + * + * @description The title of the doc + */ + title: string; + /** + * Content + * Format: markdown + * + * @description The content of the doc + */ + content: string; + mentions?: components["schemas"]["Mentions"]; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the doc was created at + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this doc + */ + createdBy: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the doc was updated at, if relevant + */ + updatedAt?: string; + /** + * Updated by + * + * @description The ID of the user who updated this doc + */ + updatedBy?: string; + }; + /** + * @example { + * "id": 123456, + * "content": "Wow, cool document!!!", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "docId": 0, + * "createdBy": "Ann6LewA" + * } + */ + DocComment: { + /** + * Doc comment ID + * + * @description The ID of the doc comment + */ + id: number; + /** + * Content + * Format: markdown + * + * @description The content of the doc comment + */ + content: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the doc comment was created at + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this doc comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the doc comment was updated at, if relevant + */ + updatedAt?: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Doc ID + * + * @description The ID of the doc + */ + docId: number; + mentions?: components["schemas"]["Mentions"]; + }; + /** + * @example { + * "channelId": "00000000-0000-0000-0000-000000000000", + * "createdBy": "Ann6LewA", + * "emote": { + * "id": 90000000, + * "name": "grinning", + * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" + * }, + * "docId": 0 + * } + */ + DocReaction: { + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * User ID + * + * @description The ID of the user who added the reaction + */ + createdBy: string; + emote: components["schemas"]["Emote"]; + /** + * Doc ID + * + * @description The ID of the doc + */ + docId: number; + }; + /** + * @example { + * "channelId": "00000000-0000-0000-0000-000000000000", + * "createdBy": "Ann6LewA", + * "emote": { + * "id": 90000000, + * "name": "grinning", + * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" + * }, + * "docId": 0, + * "docCommentId": 123456 + * } + */ + DocCommentReaction: { + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * User ID + * + * @description The ID of the user who added the reaction + */ + createdBy: string; + emote: components["schemas"]["Emote"]; + /** + * Doc ID + * + * @description The ID of the doc + */ + docId: number; + /** + * Doc comment ID + * + * @description The ID of the doc comment + */ + docCommentId: number; + }; + /** + * @example { + * "user": { + * "id": "Ann6LewA", + * "type": "user", + * "name": "Leopold Stotch", + * "createdAt": "2021-06-15T20:15:00.706Z" + * }, + * "roleIds": [], + * "nickname": "Professor Chaos", + * "joinedAt": "2021-07-15T20:15:00.706Z" + * } + */ + ServerMember: { + user: components["schemas"]["User"]; + /** Role IDs */ + roleIds: number[]; + /** Nickname */ + nickname?: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the member was created at + */ + joinedAt: string; + /** + * Is owner + * + * @default false + */ + isOwner?: boolean; + }; + /** + * @example { + * "user": { + * "id": "Ann6LewA", + * "type": "user", + * "name": "Leopold Stotch" + * }, + * "roleIds": [] + * } + */ + ServerMemberSummary: { + user: components["schemas"]["UserSummary"]; + /** Role IDs */ + roleIds: number[]; + }; + /** + * @example { + * "id": "Ann6LewA", + * "type": "user", + * "name": "Leopold Stotch", + * "createdAt": "2021-06-15T20:15:00.706Z" + * } + */ + User: { + /** + * User ID + * + * @description The ID of the user + */ + id: string; + /** + * User type + * + * @description The type of user. If this property is absent, it can assumed to be of type `user` + * @enum {string} + */ + type?: + | "bot" + | "user"; + /** + * User name + * + * @description The user's name + */ + name: string; + /** + * Avatar + * Format: media-uri + * + * @description The avatar image associated with the user + */ + avatar?: string; + /** + * Banner + * Format: media-uri + * + * @description The banner image associated with the user + */ + banner?: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the user was created at + */ + createdAt: string; + }; + /** + * @example { + * "id": "Ann6LewA", + * "type": "user", + * "name": "Leopold Stotch" + * } + */ + UserSummary: { + /** + * User ID + * + * @description The ID of the user + */ + id: string; + /** + * User type + * + * @description The type of user. If this property is absent, it can assumed to be of type `user` + * @enum {string} + */ + type?: + | "bot" + | "user"; + /** + * User name + * + * @description The user's name + */ + name: string; + /** + * Avatar + * Format: media-uri + * + * @description The avatar image associated with the user + */ + avatar?: string; + }; + /** + * @example { + * "user": { + * "id": "Ann6LewA", + * "type": "user", + * "name": "Leopold Stotch" + * }, + * "reason": "More toxic than a poison Pokémon", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA" + * } + */ + ServerMemberBan: { + user: components["schemas"]["UserSummary"]; + /** + * Reason + * + * @description The reason for the ban as submitted by the banner + */ + reason?: string; + /** + * Created by + * + * @description The ID of the user who created this server member ban + */ + createdBy: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the server member ban was created at + */ + createdAt: string; + }; + /** + * @example { + * "id": "00000000-0000-0000-0000-000000000000", + * "type": "chat", + * "name": "The Dank Cellar", + * "topic": "Dank memes ONLY", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA", + * "serverId": "wlVr3Ggl", + * "groupId": "ZVzBo83p" + * } + */ + ServerChannel: { + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + id: string; + /** + * @description The type of channel. This will determine what routes to use for creating content in a channel. For example, if this "chat", then one must use the routes for creating channel messages + * @enum {string} + */ + type: + | "announcements" + | "calendar" + | "chat" + | "docs" + | "forums" + | "list" + | "media" + | "scheduling" + | "stream" + | "voice"; + /** @description The name of the channel */ + name: string; + /** @description The topic of the channel */ + topic?: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the channel was created at + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this channel + */ + createdBy: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the channel was updated at, if relevant + */ + updatedAt?: string; + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Channel ID + * Format: uuid + * + * @description ID of the parent channel or parent thread, if present. Only relevant for server channels + */ + parentId?: string; + /** @description Only relevant for server channels */ + categoryId?: number; + /** + * Group ID + * + * @description The ID of the group + */ + groupId: string; + /** + * Is public + * + * @description Whether the channel can be accessed from users who are not member of the server + * @default false + */ + isPublic?: boolean; + /** + * Archived by + * + * @description The ID of the user who archived this channel + */ + archivedBy?: string; + /** + * Archived at + * Format: date-time + * + * @description The ISO 8601 timestamp that the channel was archived at, if relevant + */ + archivedAt?: string; + }; + /** + * @example { + * "id": "wlVr3Ggl", + * "type": "community", + * "name": "Guilded", + * "url": "Guilded-Official", + * "about": "The Official Guilded Server! For devs, friends, and fans alike!", + * "ownerId": "Ann6LewA", + * "createdAt": "2018-10-05T20:15:00.706Z", + * "isVerified": true, + * "timezone": "America/Los Angeles (PST/PDT)" + * } + */ + Server: { + /** + * Server ID + * + * @description The ID of the server + */ + id: string; + /** + * Created by + * + * @description The ID of the user who created this server + */ + ownerId: string; + /** + * Server type + * + * @description The type of server designated from the server's settings page + * @enum {string} + */ + type?: + | "clan" + | "community" + | "friends" + | "guild" + | "organization" + | "other" + | "streaming" + | "team"; + /** + * Server name + * + * @description The name given to the server + */ + name: string; + /** + * Server URL + * + * @description The URL that the server can be accessible from. For example, a value of "Guilded-Official" means the server can be accessible from https://www.guilded.gg/Guilded-Official + */ + url?: string; + /** + * Description + * + * @description The description associated with the server + */ + about?: string; + /** + * Avatar + * Format: media-uri + * + * @description The avatar image associated with the server + */ + avatar?: string; + /** + * Banner + * Format: media-uri + * + * @description The banner image associated with the server + */ + banner?: string; + /** + * Timezone + * + * @description The timezone associated with the server + */ + timezone?: string; + /** + * Is verified + * + * @description The verified status of the server + */ + isVerified?: boolean; + /** + * Channel ID + * Format: uuid + * + * @description The channel ID of the default channel of the server. This channel is defined as the first chat or voice channel in the left sidebar of a server in our UI. This channel is useful for sending welcome messages, though note that a bot may not have permissions to interact with this channel depending on how the server is configured. + */ + defaultChannelId?: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the server was created at + */ + createdAt: string; + }; + /** + * @example { + * "id": "00000000-0000-0000-0000-000000000000", + * "serverId": "wlVr3Ggl", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "name": "E-102 Gamma", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA" + * } + */ + Webhook: { + /** + * Webhook ID + * Format: uuid + * + * @description The ID of the webhook + */ + id: string; + /** + * Name + * + * @description The name of the webhook + */ + name: string; + /** + * Avatar + * Format: media-uri + * + * @description The avatar image associated with the webhook + */ + avatar?: string; + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the webhook was created at + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this webhook + */ + createdBy: string; + /** + * Deleted at + * Format: date-time + * + * @description The ISO 8601 timestamp that the webhook was deleted at + */ + deletedAt?: string; + /** + * Token + * + * @description The token of the webhook + */ + token?: string; + }; + /** + * @example { + * "id": 1, + * "serverId": "wlVr3Ggl", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "name": "Surprise LAN party for my wife 🤫", + * "description": "**Don't say anything to her!** She's gonna love playing Call of Duty all night", + * "location": "My house!", + * "url": "https://www.surprisepartygame.com/", + * "duration": 60, + * "color": 16106496, + * "startsAt": "2022-06-16T00:00:00.000Z", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA" + * } + */ + CalendarEvent: { + /** + * Calendar event ID + * + * @description The ID of the calendar event + */ + id: number; + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Name + * + * @description The name of the event + */ + name: string; + /** + * Description + * Format: markdown + * + * @description The description of the event + */ + description?: string; + /** + * Location + * + * @description The location of the event + */ + location?: string; + /** + * Format: uri + * + * @description A URL to associate with the event + */ + url?: string; + /** @description The color of the event when viewing in the calendar */ + color?: number; + /** @description Is this event a repeating event */ + repeats?: boolean; + /** + * Calendar event series ID + * Format: uuid + * + * @description The ID of the calendar event series. Only shows if the event is repeating + */ + seriesId?: string; + /** + * Role IDs + * + * @description The role IDs to restrict the event to + */ + roleIds?: number[]; + /** + * RSVP disabled + * + * @description When disabled, users will not be able to RSVP to the event + */ + rsvpDisabled?: boolean; + /** + * Is all day + * + * @description Does the event last all day + */ + isAllDay?: boolean; + /** @description The number of RSVPs to allow before waitlisting RSVPs */ + rsvpLimit?: number; + /** @description When `rsvpLimit` is set, users from the waitlist will be added as space becomes available in the event */ + autofillWaitlist?: boolean; + /** + * Starts at + * Format: date-time + * + * @description The ISO 8601 timestamp that the event starts at + */ + startsAt: string; + /** + * Duration + * + * @description The duration of the event _**in minutes**_ + */ + duration?: number; + /** Is private */ + isPrivate?: boolean; + mentions?: components["schemas"]["Mentions"]; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the event was created at + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this event + */ + createdBy: string; + cancellation?: { + /** + * Description + * Format: markdown + * + * @description The description of event cancellation + */ + description?: string; + /** + * Created by + * + * @description The ID of the user who created this event cancellation + */ + createdBy: string; + }; + }; + /** + * @example { + * "id": 90000000, + * "name": "grinning", + * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" + * } + */ + Emote: { + /** + * Emote ID + * + * @description The ID of the emote + */ + id: number; + /** + * Name + * + * @description The name of the emote + */ + name: string; + /** + * Emote URL + * Format: media-uri + * + * @description The URL of the emote image + */ + url: string; + /** + * Server ID + * + * @description The ID of the server the emote was created on + */ + serverId?: string; + }; + /** + * @example { + * "calendarEventId": 1, + * "channelId": "00000000-0000-0000-0000-000000000000", + * "serverId": "wlVr3Ggl", + * "userId": "Ann6LewA", + * "status": "going", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA" + * } + */ + CalendarEventRsvp: { + /** + * Calendar event ID + * + * @description The ID of the calendar event + */ + calendarEventId: number; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * User ID + * + * @description The ID of the user + */ + userId: string; + /** + * Status + * + * @description The status of the RSVP + * @enum {string} + */ + status: + | "declined" + | "going" + | "invited" + | "maybe" + | "not responded" + | "waitlisted"; + /** + * Created by + * + * @description The ID of the user who created this RSVP + */ + createdBy: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the RSVP was created at + */ + createdAt: string; + /** + * Updated by + * + * @description The ID of the user who updated this RSVP + */ + updatedBy?: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the RSVP was updated at, if relevant + */ + updatedAt?: string; + }; + /** + * @example { + * "id": 1234567890, + * "content": "I will be there!!", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "createdAt": "2022-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA", + * "calendarEventId": 987654321 + * } + */ + CalendarEventComment: { + /** + * Calendar event comment ID + * + * @description The ID of the calendar event comment + */ + id: number; + /** + * Content + * Format: markdown + * + * @description The content of the calendar event comment + */ + content: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the calendar event comment was created at + */ + createdAt: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the calendar event comment was updated at, if relevant + */ + updatedAt?: string; + /** + * Calendar event ID + * + * @description The ID of the calendar event + */ + calendarEventId: number; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Created by + * + * @description The ID of the user who created this calendar event comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + mentions?: components["schemas"]["Mentions"]; + }; + /** + * @example { + * "channelId": "00000000-0000-0000-0000-000000000000", + * "createdBy": "Ann6LewA", + * "emote": { + * "id": 90000000, + * "name": "grinning", + * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" + * }, + * "calendarEventId": 1 + * } + */ + CalendarEventReaction: { + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * User ID + * + * @description The ID of the user who added the reaction + */ + createdBy: string; + emote: components["schemas"]["Emote"]; + /** + * Calendar event ID + * + * @description The ID of the calendar event + */ + calendarEventId: number; + }; + /** + * @example { + * "channelId": "00000000-0000-0000-0000-000000000000", + * "createdBy": "Ann6LewA", + * "emote": { + * "id": 90000000, + * "name": "grinning", + * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" + * }, + * "calendarEventId": 1, + * "calendarEventCommentId": 1234567890 + * } + */ + CalendarEventCommentReaction: { + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * User ID + * + * @description The ID of the user who added the reaction + */ + createdBy: string; + emote: components["schemas"]["Emote"]; + /** + * Calendar event ID + * + * @description The ID of the calendar event + */ + calendarEventId: number; + /** + * Calendar event comment ID + * + * @description The ID of the calendar event comment + */ + calendarEventCommentId: number; + }; + /** + * @example { + * "id": "00000000-0000-0000-0000-000000000000", + * "serverId": "wlVr3Ggl", + * "channelId": "00000000-0000-0000-0000-000000000000" + * } + */ + CalendarEventSeries: { + /** + * Calendar event series ID + * Format: uuid + * + * @description The ID of the calendar event series + */ + id: string; + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + }; + /** + * @example { + * "id": "9RVMoDZy", + * "serverId": "wlVr3Ggl", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "createdAt": "2021-06-15T20:15:00.706Z", + * "createdBy": "Ann6LewA", + * "title": "Pizza Party, don't be tardy!", + * "content": "Grab a slice, don't be slow, At our pizza party, it's the way to go! Toppings galore, cheesy delight, Come join us, it'll be out of sight!" + * } + */ + Announcement: { + /** + * Announcement ID + * + * @description The ID of the announcement + */ + id: string; + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the announcement was created at + */ + createdAt: string; + /** + * Created by + * + * @description The ID of the user who created this announcement + */ + createdBy: string; + /** + * Content + * Format: markdown + * + * @description The content of the announcement + */ + content: string; + mentions?: components["schemas"]["Mentions"]; + /** + * Title + * + * @description The title of the announcement + */ + title: string; + }; + /** + * @example { + * "channelId": "00000000-0000-0000-0000-000000000000", + * "createdBy": "Ann6LewA", + * "emote": { + * "id": 90000000, + * "name": "grinning", + * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" + * }, + * "announcementId": "9RVMoDZy" + * } + */ + AnnouncementReaction: { + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * User ID + * + * @description The ID of the user who added the reaction + */ + createdBy: string; + emote: components["schemas"]["Emote"]; + /** + * Announcement ID + * + * @description The ID of the announcement + */ + announcementId: string; + }; + /** + * @example { + * "id": 123456, + * "content": "Now THAT is one awesome announcement!!!", + * "createdAt": "2023-04-07T16:19:00.000Z", + * "channelId": "00000000-0000-0000-0000-000000000000", + * "announcementId": "9RVMoDZy", + * "createdBy": "Ann6LewA" + * } + */ + AnnouncementComment: { + /** + * Announcement comment ID + * + * @description The ID of the announcement comment + */ + id: number; + /** + * Content + * Format: markdown + * + * @description The content of the announcement comment + */ + content: string; + /** + * Created at + * Format: date-time + * + * @description The ISO 8601 timestamp that the announcement comment was created at + */ + createdAt: string; + /** + * Updated at + * Format: date-time + * + * @description The ISO 8601 timestamp that the announcement comment was updated at, if relevant + */ + updatedAt?: string; + /** + * Created by + * + * @description The ID of the user who created this announcement comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Announcement ID + * + * @description The ID of the announcement + */ + announcementId: string; + mentions?: components["schemas"]["Mentions"]; + }; + /** + * @example { + * "channelId": "00000000-0000-0000-0000-000000000000", + * "createdBy": "Ann6LewA", + * "emote": { + * "id": 90000000, + * "name": "grinning", + * "url": "https://img.guildedcdn.com/asset/Emojis/grinning.webp" + * }, + * "announcementId": "9RVMoDZy", + * "announcementCommentId": 123456 + * } + */ + AnnouncementCommentReaction: { + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * User ID + * + * @description The ID of the user who added the reaction + */ + createdBy: string; + emote: components["schemas"]["Emote"]; + /** + * Announcement ID + * + * @description The ID of the announcement + */ + announcementId: string; + /** + * Announcement comment ID + * + * @description The ID of the announcement comment + */ + announcementCommentId: number; + }; + }; + responses: { + _WelcomeMessage: { + content: { + "application/json": { + /** @description The interval in milliseconds that your bot should be configured to send ping frames for the bot's [heartbeat](/docs/api/heartbeat) to be considered valid. */ + heartbeatIntervalMs: number; + /** @description The last message's ID that was sent to this bot. See [event replay](/docs/api/replay) for more details */ + lastMessageId: string; + /** + * Bot ID + * Format: uuid + * + * @description The ID of the bot + */ + botId: string; + user: components["schemas"]["User"]; + }; + }; + }; + /** @description Emitted when a bot is added to a server */ + BotServerMembershipCreated: { + content: { + "application/json": { + server: components["schemas"]["Server"]; + /** + * Created by + * + * @description The ID of the user who created this server membership + */ + createdBy: string; + }; + }; + }; + /** @description Emitted when a bot is removed from a server */ + BotServerMembershipDeleted: { + content: { + "application/json": { + server: components["schemas"]["Server"]; + /** + * Deleted by + * + * @description The ID of the user who deleted this server membership + */ + deletedBy: string; + }; + }; + }; + ChatMessageCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + message: components["schemas"]["ChatMessage"]; + }; + }; + }; + ChatMessageUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + message: components["schemas"]["ChatMessage"]; + }; + }; + }; + ChatMessageDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + message: { + /** + * Message ID + * Format: uuid + * + * @description The ID of the message + */ + id: string; + /** + * Server ID + * + * @description The ID of the server + */ + serverId?: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Deleted at + * Format: date-time + * + * @description The ISO 8601 timestamp that the message was deleted at + */ + deletedAt: string; + /** Is private */ + isPrivate?: boolean; + }; + }; + }; + }; + ServerMemberJoined: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + member: components["schemas"]["ServerMember"]; + }; + }; + }; + ServerMemberRemoved: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * User ID + * + * @description The ID of the user + */ + userId: string; + /** + * Is kick? + * + * @description If this member leaving was the result of a kick + */ + isKick?: boolean; + /** + * Is ban? + * + * @description If this member leaving was the result of a ban + */ + isBan?: boolean; + }; + }; + }; + ServerMemberBanned: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + serverMemberBan: components["schemas"]["ServerMemberBan"]; + }; + }; + }; + ServerMemberUnbanned: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + serverMemberBan: components["schemas"]["ServerMemberBan"]; + }; + }; + }; + ServerMemberUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + userInfo: { + /** + * User ID + * + * @description The ID of the user + */ + id: string; + /** + * Nickname + * + * @description The nickname that was just updated for the user + */ + nickname?: + | string + | null; + }; + }; + }; + }; + ServerRolesUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + memberRoleIds: { + /** + * User ID + * + * @description The ID of the member that had roles updated + */ + userId: string; + /** + * Role IDs + * + * @description The IDs of the roles that the member currently has _after_ this operation + */ + roleIds: number[]; + }[]; + }; + }; + }; + ServerChannelCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + channel: components["schemas"]["ServerChannel"]; + }; + }; + }; + ServerChannelUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + channel: components["schemas"]["ServerChannel"]; + }; + }; + }; + ServerChannelDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + channel: components["schemas"]["ServerChannel"]; + }; + }; + }; + ServerMemberSocialLinkCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + socialLink: components["schemas"]["SocialLink"]; + }; + }; + }; + ServerMemberSocialLinkUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + socialLink: components["schemas"]["SocialLink"]; + }; + }; + }; + ServerMemberSocialLinkDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + socialLink: components["schemas"]["SocialLink"]; + }; + }; + }; + ServerWebhookCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + webhook: components["schemas"]["Webhook"]; + }; + }; + }; + ServerWebhookUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + webhook: components["schemas"]["Webhook"]; + }; + }; + }; + DocCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + doc: components["schemas"]["Doc"]; + }; + }; + }; + DocUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + doc: components["schemas"]["Doc"]; + }; + }; + }; + DocDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + doc: components["schemas"]["Doc"]; + }; + }; + }; + DocCommentCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + docComment: components["schemas"]["DocComment"]; + }; + }; + }; + DocCommentDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + docComment: components["schemas"]["DocComment"]; + }; + }; + }; + DocCommentUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + docComment: components["schemas"]["DocComment"]; + }; + }; + }; + CalendarEventCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + calendarEvent: components["schemas"]["CalendarEvent"]; + }; + }; + }; + CalendarEventUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + calendarEvent: components["schemas"]["CalendarEvent"]; + }; + }; + }; + CalendarEventDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + calendarEvent: components["schemas"]["CalendarEvent"]; + }; + }; + }; + ForumTopicCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + forumTopic: components["schemas"]["ForumTopic"]; + }; + }; + }; + ForumTopicUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + forumTopic: components["schemas"]["ForumTopic"]; + }; + }; + }; + ForumTopicDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + forumTopic: components["schemas"]["ForumTopic"]; + }; + }; + }; + ForumTopicPinned: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + forumTopic: components["schemas"]["ForumTopic"]; + }; + }; + }; + ForumTopicUnpinned: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + forumTopic: components["schemas"]["ForumTopic"]; + }; + }; + }; + ForumTopicReactionCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["ForumTopicReaction"]; + }; + }; + }; + ForumTopicReactionDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["ForumTopicReaction"]; + }; + }; + }; + ForumTopicLocked: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + forumTopic: components["schemas"]["ForumTopic"]; + }; + }; + }; + ForumTopicUnlocked: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + forumTopic: components["schemas"]["ForumTopic"]; + }; + }; + }; + ForumTopicCommentCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + forumTopicComment: components["schemas"]["ForumTopicComment"]; + }; + }; + }; + ForumTopicCommentUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + forumTopicComment: components["schemas"]["ForumTopicComment"]; + }; + }; + }; + ForumTopicCommentDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + forumTopicComment: components["schemas"]["ForumTopicComment"]; + }; + }; + }; + CalendarEventRsvpUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + calendarEventRsvp: components["schemas"]["CalendarEventRsvp"]; + }; + }; + }; + CalendarEventRsvpManyUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + calendarEventRsvps: components["schemas"]["CalendarEventRsvp"][]; + }; + }; + }; + CalendarEventRsvpDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + calendarEventRsvp: components["schemas"]["CalendarEventRsvp"]; + }; + }; + }; + ListItemCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + listItem: components["schemas"]["ListItem"]; + }; + }; + }; + ListItemUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + listItem: components["schemas"]["ListItem"]; + }; + }; + }; + ListItemDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + listItem: components["schemas"]["ListItem"]; + }; + }; + }; + ListItemCompleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + listItem: components["schemas"]["ListItem"]; + }; + }; + }; + ListItemUncompleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + listItem: components["schemas"]["ListItem"]; + }; + }; + }; + ChannelMessageReactionCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["ChatMessageReaction"]; + }; + }; + }; + ChannelMessageReactionDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Deleted by + * + * @description The ID of the user who deleted this reaction + */ + deletedBy: string; + reaction: components["schemas"]["ChatMessageReaction"]; + }; + }; + }; + ChannelMessageReactionManyDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + /** + * Channel ID + * Format: uuid + * + * @description The ID of the channel + */ + channelId: string; + /** + * Message ID + * Format: uuid + * + * @description The ID of the message + */ + messageId: string; + /** + * Deleted by + * + * @description The ID of the user who deleted this reaction + */ + deletedBy: string; + /** @description The count of reactions that were removed */ + count: number; + /** @description If present, only reactions of this emote were bulk removed from the message */ + emote?: components["schemas"]["Emote"]; + }; + }; + }; + ForumTopicCommentReactionCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["ForumTopicCommentReaction"]; + }; + }; + }; + ForumTopicCommentReactionDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["ForumTopicCommentReaction"]; + }; + }; + }; + CalendarEventCommentCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + calendarEventComment: components["schemas"]["CalendarEventComment"]; + }; + }; + }; + CalendarEventCommentDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + calendarEventComment: components["schemas"]["CalendarEventComment"]; + }; + }; + }; + CalendarEventCommentUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + calendarEventComment: components["schemas"]["CalendarEventComment"]; + }; + }; + }; + CalendarEventReactionCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["CalendarEventReaction"]; + }; + }; + }; + CalendarEventReactionDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["CalendarEventReaction"]; + }; + }; + }; + CalendarEventCommentReactionCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["CalendarEventCommentReaction"]; + }; + }; + }; + CalendarEventCommentReactionDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["CalendarEventCommentReaction"]; + }; + }; + }; + DocReactionCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["DocReaction"]; + }; + }; + }; + DocReactionDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["DocReaction"]; + }; + }; + }; + DocCommentReactionCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["DocCommentReaction"]; + }; + }; + }; + DocCommentReactionDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["DocCommentReaction"]; + }; + }; + }; + CalendarEventSeriesUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + calendarEventSeries: components["schemas"]["CalendarEventSeries"]; + /** + * Calendar event ID + * + * @description The calendar event updates started at + */ + calendarEventId?: number; + }; + }; + }; + CalendarEventSeriesDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + calendarEventSeries: components["schemas"]["CalendarEventSeries"]; + /** + * Calendar event ID + * + * @description The calendar event deletions started at + */ + calendarEventId?: number; + }; + }; + }; + AnnouncementCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + announcement: components["schemas"]["Announcement"]; + }; + }; + }; + AnnouncementUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + announcement: components["schemas"]["Announcement"]; + }; + }; + }; + AnnouncementDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + announcement: components["schemas"]["Announcement"]; + }; + }; + }; + AnnouncementReactionCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["AnnouncementReaction"]; + }; + }; + }; + AnnouncementReactionDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["AnnouncementReaction"]; + }; + }; + }; + AnnouncementCommentCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + announcementComment: components["schemas"]["AnnouncementComment"]; + }; + }; + }; + AnnouncementCommentUpdated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + announcementComment: components["schemas"]["AnnouncementComment"]; + }; + }; + }; + AnnouncementCommentDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + announcementComment: components["schemas"]["AnnouncementComment"]; + }; + }; + }; + AnnouncementCommentReactionCreated: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["AnnouncementCommentReaction"]; + }; + }; + }; + AnnouncementCommentReactionDeleted: { + content: { + "application/json": { + /** + * Server ID + * + * @description The ID of the server + */ + serverId: string; + reaction: components["schemas"]["AnnouncementCommentReaction"]; + }; + }; + }; + }; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; }; export type external = Record; diff --git a/packages/api/lib/generated/router/GuildedRouter.ts b/packages/api/lib/generated/router/GuildedRouter.ts index cbbe40f4..bda0f9bc 100644 --- a/packages/api/lib/generated/router/GuildedRouter.ts +++ b/packages/api/lib/generated/router/GuildedRouter.ts @@ -3,11 +3,13 @@ import type { BaseHttpRequest } from "./core/BaseHttpRequest"; import { FetchHttpRequest } from "./core/FetchHttpRequest"; +import { RestManager } from "../../rest/RestManager"; import { AnnouncementCommentsService } from "./services/AnnouncementCommentsService"; import { AnnouncementsService } from "./services/AnnouncementsService"; import { CalendarEventCommentsService } from "./services/CalendarEventCommentsService"; -import { CalendarEventsService } from "./services/CalendarEventsService"; import { CalendarEventSeriesService } from "./services/CalendarEventSeriesService"; +import { CalendarEventsService } from "./services/CalendarEventsService"; +import { CategoriesService } from "./services/CategoriesService"; import { ChannelsService } from "./services/ChannelsService"; import { ChatService } from "./services/ChatService"; import { DocCommentsService } from "./services/DocCommentsService"; @@ -22,76 +24,187 @@ import { MembersService } from "./services/MembersService"; import { ReactionsService } from "./services/ReactionsService"; import { RoleMembershipService } from "./services/RoleMembershipService"; import { RolesService } from "./services/RolesService"; -import { ServersService } from "./services/ServersService"; +import { ServerSubscriptionService } from "./services/ServerSubscriptionService"; import { ServerXpService } from "./services/ServerXpService"; +import { ServersService } from "./services/ServersService"; import { SocialLinksService } from "./services/SocialLinksService"; -import { UsersService } from "./services/UsersService"; import { UserStatusService } from "./services/UserStatusService"; +import { UsersService } from "./services/UsersService"; import { WebhookService } from "./services/WebhookService"; -import { RestManager } from "../../rest/RestManager"; -import { ServerSubscriptionService } from "./services/ServerSubscriptionService"; -import { CategoriesService } from "./services/CategoriesService"; export class GuildedRouter { - public readonly announcementComments: AnnouncementCommentsService; - public readonly announcements: AnnouncementsService; - public readonly calendarEventComments: CalendarEventCommentsService; - public readonly calendarEvents: CalendarEventsService; - public readonly calendarEventSeries: CalendarEventSeriesService; - public readonly categories: CategoriesService; - public readonly channels: ChannelsService; - public readonly chat: ChatService; - public readonly docComments: DocCommentsService; - public readonly docs: DocsService; - public readonly forumComments: ForumCommentsService; - public readonly forums: ForumsService; - public readonly groupMembership: GroupMembershipService; - public readonly groups: GroupsService; - public readonly listItems: ListItemsService; - public readonly memberBans: MemberBansService; - public readonly members: MembersService; - public readonly reactions: ReactionsService; - public readonly roleMembership: RoleMembershipService; - public readonly roles: RolesService; - public readonly servers: ServersService; - public readonly serverXp: ServerXpService; - public readonly socialLinks: SocialLinksService; - public readonly users: UsersService; - public readonly userStatus: UserStatusService; - public readonly webhook: WebhookService; - public readonly serverSubscriptions: ServerSubscriptionService; + public readonly announcementComments: AnnouncementCommentsService; + public readonly announcements: AnnouncementsService; + public readonly calendarEventComments: CalendarEventCommentsService; + public readonly calendarEvents: CalendarEventsService; + public readonly calendarEventSeries: CalendarEventSeriesService; + public readonly categories: CategoriesService; + public readonly channels: ChannelsService; + public readonly chat: ChatService; + public readonly docComments: DocCommentsService; + public readonly docs: DocsService; + public readonly forumComments: ForumCommentsService; + public readonly forums: ForumsService; + public readonly groupMembership: GroupMembershipService; + public readonly groups: GroupsService; + public readonly listItems: ListItemsService; + public readonly memberBans: MemberBansService; + public readonly members: MembersService; + public readonly reactions: ReactionsService; + public readonly roleMembership: RoleMembershipService; + public readonly roles: RolesService; + public readonly servers: ServersService; + public readonly serverXp: ServerXpService; + public readonly socialLinks: SocialLinksService; + public readonly users: UsersService; + public readonly userStatus: UserStatusService; + public readonly webhook: WebhookService; + public readonly serverSubscriptions: ServerSubscriptionService; - public readonly request: BaseHttpRequest; + public readonly request: BaseHttpRequest; - constructor(rest: RestManager) { - this.request = new FetchHttpRequest(rest); + constructor( + rest: RestManager, + ) { + this.request = + new FetchHttpRequest( + rest, + ); - this.announcementComments = new AnnouncementCommentsService(this.request); - this.announcements = new AnnouncementsService(this.request); - this.calendarEventComments = new CalendarEventCommentsService(this.request); - this.calendarEvents = new CalendarEventsService(this.request); - this.calendarEventSeries = new CalendarEventSeriesService(this.request); - this.categories = new CategoriesService(this.request); - this.channels = new ChannelsService(this.request); - this.chat = new ChatService(this.request); - this.docComments = new DocCommentsService(this.request); - this.docs = new DocsService(this.request); - this.forumComments = new ForumCommentsService(this.request); - this.forums = new ForumsService(this.request); - this.groupMembership = new GroupMembershipService(this.request); - this.groups = new GroupsService(this.request); - this.listItems = new ListItemsService(this.request); - this.memberBans = new MemberBansService(this.request); - this.members = new MembersService(this.request); - this.reactions = new ReactionsService(this.request); - this.roleMembership = new RoleMembershipService(this.request); - this.roles = new RolesService(this.request); - this.servers = new ServersService(this.request); - this.serverXp = new ServerXpService(this.request); - this.socialLinks = new SocialLinksService(this.request); - this.users = new UsersService(this.request); - this.userStatus = new UserStatusService(this.request); - this.webhook = new WebhookService(this.request); - this.serverSubscriptions = new ServerSubscriptionService(this.request); - } + this.announcementComments = + new AnnouncementCommentsService( + this + .request, + ); + this.announcements = + new AnnouncementsService( + this + .request, + ); + this.calendarEventComments = + new CalendarEventCommentsService( + this + .request, + ); + this.calendarEvents = + new CalendarEventsService( + this + .request, + ); + this.calendarEventSeries = + new CalendarEventSeriesService( + this + .request, + ); + this.categories = + new CategoriesService( + this + .request, + ); + this.channels = + new ChannelsService( + this + .request, + ); + this.chat = + new ChatService( + this + .request, + ); + this.docComments = + new DocCommentsService( + this + .request, + ); + this.docs = + new DocsService( + this + .request, + ); + this.forumComments = + new ForumCommentsService( + this + .request, + ); + this.forums = + new ForumsService( + this + .request, + ); + this.groupMembership = + new GroupMembershipService( + this + .request, + ); + this.groups = + new GroupsService( + this + .request, + ); + this.listItems = + new ListItemsService( + this + .request, + ); + this.memberBans = + new MemberBansService( + this + .request, + ); + this.members = + new MembersService( + this + .request, + ); + this.reactions = + new ReactionsService( + this + .request, + ); + this.roleMembership = + new RoleMembershipService( + this + .request, + ); + this.roles = + new RolesService( + this + .request, + ); + this.servers = + new ServersService( + this + .request, + ); + this.serverXp = + new ServerXpService( + this + .request, + ); + this.socialLinks = + new SocialLinksService( + this + .request, + ); + this.users = + new UsersService( + this + .request, + ); + this.userStatus = + new UserStatusService( + this + .request, + ); + this.webhook = + new WebhookService( + this + .request, + ); + this.serverSubscriptions = + new ServerSubscriptionService( + this + .request, + ); + } } diff --git a/packages/api/lib/generated/router/core/ApiError.ts b/packages/api/lib/generated/router/core/ApiError.ts index 7eca264d..5e0d5cdd 100644 --- a/packages/api/lib/generated/router/core/ApiError.ts +++ b/packages/api/lib/generated/router/core/ApiError.ts @@ -4,20 +4,32 @@ import type { ApiRequestOptions } from "./ApiRequestOptions"; import type { ApiResult } from "./ApiResult"; export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: any; - public readonly request: ApiRequestOptions; + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: any; + public readonly request: ApiRequestOptions; - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); + constructor( + request: ApiRequestOptions, + response: ApiResult, + message: string, + ) { + super( + message, + ); - this.name = "ApiError"; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } + this.name = + "ApiError"; + this.url = + response.url; + this.status = + response.status; + this.statusText = + response.statusText; + this.body = + response.body; + this.request = + request; + } } diff --git a/packages/api/lib/generated/router/core/ApiRequestOptions.ts b/packages/api/lib/generated/router/core/ApiRequestOptions.ts index bc33184d..e2e11e4b 100644 --- a/packages/api/lib/generated/router/core/ApiRequestOptions.ts +++ b/packages/api/lib/generated/router/core/ApiRequestOptions.ts @@ -1,15 +1,40 @@ /* istanbul ignore file */ /* eslint-disable */ export type ApiRequestOptions = { - readonly method: "GET" | "PUT" | "POST" | "DELETE" | "OPTIONS" | "HEAD" | "PATCH"; - readonly url: string; - readonly path?: Record; - readonly cookies?: Record; - readonly headers?: Record; - readonly query?: Record; - readonly formData?: Record; - readonly body?: any; - readonly mediaType?: string; - readonly responseHeader?: string; - readonly errors?: Record; + readonly method: + | "GET" + | "PUT" + | "POST" + | "DELETE" + | "OPTIONS" + | "HEAD" + | "PATCH"; + readonly url: string; + readonly path?: Record< + string, + any + >; + readonly cookies?: Record< + string, + any + >; + readonly headers?: Record< + string, + any + >; + readonly query?: Record< + string, + any + >; + readonly formData?: Record< + string, + any + >; + readonly body?: any; + readonly mediaType?: string; + readonly responseHeader?: string; + readonly errors?: Record< + number, + string + >; }; diff --git a/packages/api/lib/generated/router/core/ApiResult.ts b/packages/api/lib/generated/router/core/ApiResult.ts index 20b0bef7..227b831a 100644 --- a/packages/api/lib/generated/router/core/ApiResult.ts +++ b/packages/api/lib/generated/router/core/ApiResult.ts @@ -1,9 +1,9 @@ /* istanbul ignore file */ /* eslint-disable */ export type ApiResult = { - readonly url: string; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly body: any; + readonly url: string; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly body: any; }; diff --git a/packages/api/lib/generated/router/core/BaseHttpRequest.ts b/packages/api/lib/generated/router/core/BaseHttpRequest.ts index dba5b03d..d5a2243d 100644 --- a/packages/api/lib/generated/router/core/BaseHttpRequest.ts +++ b/packages/api/lib/generated/router/core/BaseHttpRequest.ts @@ -5,7 +5,13 @@ import type { ApiRequestOptions } from "./ApiRequestOptions"; import type { CancelablePromise } from "./CancelablePromise"; export abstract class BaseHttpRequest { - constructor(public readonly rest: RestManager) {} + constructor( + public readonly rest: RestManager, + ) {} - public abstract request(options: ApiRequestOptions): CancelablePromise; + public abstract request< + T, + >( + options: ApiRequestOptions, + ): CancelablePromise; } diff --git a/packages/api/lib/generated/router/core/FetchHttpRequest.ts b/packages/api/lib/generated/router/core/FetchHttpRequest.ts index a0a999de..e21e8a58 100644 --- a/packages/api/lib/generated/router/core/FetchHttpRequest.ts +++ b/packages/api/lib/generated/router/core/FetchHttpRequest.ts @@ -7,17 +7,21 @@ import type { CancelablePromise } from "./CancelablePromise"; import { request as __request } from "./request"; export class FetchHttpRequest extends BaseHttpRequest { - constructor(rest: RestManager) { - super(rest); - } - - /** - * Request method - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ - public override request(options: ApiRequestOptions): CancelablePromise { - return __request(this.rest, options); - } + /** + * Request method + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ + public override request< + T, + >( + options: ApiRequestOptions, + ): CancelablePromise { + return __request( + this + .rest, + options, + ); + } } diff --git a/packages/api/lib/generated/router/core/OpenAPI.ts b/packages/api/lib/generated/router/core/OpenAPI.ts index d8e03c96..481cde80 100644 --- a/packages/api/lib/generated/router/core/OpenAPI.ts +++ b/packages/api/lib/generated/router/core/OpenAPI.ts @@ -6,25 +6,38 @@ type Resolver = (options: ApiRequestOptions) => Promise; type Headers = Record; export type OpenAPIConfig = { - BASE: string; - VERSION: string; - WITH_CREDENTIALS: boolean; - CREDENTIALS: "include" | "omit" | "same-origin"; - TOKEN?: string | Resolver; - USERNAME?: string | Resolver; - PASSWORD?: string | Resolver; - HEADERS?: Headers | Resolver; - ENCODE_PATH?: (path: string) => string; + BASE: string; + VERSION: string; + WITH_CREDENTIALS: boolean; + CREDENTIALS: + | "include" + | "omit" + | "same-origin"; + TOKEN?: + | string + | Resolver; + USERNAME?: + | string + | Resolver; + PASSWORD?: + | string + | Resolver; + HEADERS?: + | Headers + | Resolver; + ENCODE_PATH?: ( + path: string, + ) => string; }; export const OpenAPI: OpenAPIConfig = { - BASE: "https://www.guilded.gg/api/v1", - VERSION: "0.0.1", - WITH_CREDENTIALS: false, - CREDENTIALS: "include", - TOKEN: undefined, - USERNAME: undefined, - PASSWORD: undefined, - HEADERS: undefined, - ENCODE_PATH: undefined, + BASE: "https://www.guilded.gg/api/v1", + VERSION: "0.0.1", + WITH_CREDENTIALS: false, + CREDENTIALS: "include", + TOKEN: undefined, + USERNAME: undefined, + PASSWORD: undefined, + HEADERS: undefined, + ENCODE_PATH: undefined, }; diff --git a/packages/api/lib/generated/router/core/request.ts b/packages/api/lib/generated/router/core/request.ts index 3265dde2..35a60b41 100644 --- a/packages/api/lib/generated/router/core/request.ts +++ b/packages/api/lib/generated/router/core/request.ts @@ -4,21 +4,38 @@ import { RestManager } from "../../../rest/RestManager"; import type { ApiRequestOptions } from "./ApiRequestOptions"; export function request(rest: RestManager, options: ApiRequestOptions) { - let formattedPath = options.url; - if (options.path) { - for (const key in options.path) { - formattedPath = formattedPath.replace(`{${key}}`, options.path[key]); - } - } + let formattedPath = + options.url; + if ( + options.path + ) { + for (const key in options.path) { + formattedPath = + formattedPath.replace( + `{${key}}`, + options + .path[ + key + ], + ); + } + } - return rest - .make({ - method: options.method, - headers: options.headers, - isFormData: false, - path: formattedPath, - query: options.query, - body: options.body, - }) - .then((x) => x[1] as T); + return rest + .make( + { + method: options.method, + headers: options.headers, + isFormData: false, + path: formattedPath, + query: options.query, + body: options.body, + }, + ) + .then( + ( + x, + ) => + x[1] as T, + ); } diff --git a/packages/api/lib/generated/router/models/Announcement.ts b/packages/api/lib/generated/router/models/Announcement.ts index d9b31a58..fcff3c93 100644 --- a/packages/api/lib/generated/router/models/Announcement.ts +++ b/packages/api/lib/generated/router/models/Announcement.ts @@ -6,33 +6,33 @@ import type { Mentions } from "./Mentions"; export type Announcement = { - /** - * The ID of the announcement - */ - id: string; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The ISO 8601 timestamp that the announcement was created at - */ - createdAt: string; - /** - * The ID of the user who created this announcement - */ - createdBy: string; - /** - * The content of the announcement - */ - content: string; - mentions?: Mentions; - /** - * The title of the announcement - */ - title: string; + /** + * The ID of the announcement + */ + id: string; + /** + * The ID of the server + */ + serverId: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ISO 8601 timestamp that the announcement was created at + */ + createdAt: string; + /** + * The ID of the user who created this announcement + */ + createdBy: string; + /** + * The content of the announcement + */ + content: string; + mentions?: Mentions; + /** + * The title of the announcement + */ + title: string; }; diff --git a/packages/api/lib/generated/router/models/AnnouncementComment.ts b/packages/api/lib/generated/router/models/AnnouncementComment.ts index a1fe0abe..6a1dc50c 100644 --- a/packages/api/lib/generated/router/models/AnnouncementComment.ts +++ b/packages/api/lib/generated/router/models/AnnouncementComment.ts @@ -6,33 +6,33 @@ import type { Mentions } from "./Mentions"; export type AnnouncementComment = { - /** - * The ID of the announcement comment - */ - id: number; - /** - * The content of the announcement comment - */ - content: string; - /** - * The ISO 8601 timestamp that the announcement comment was created at - */ - createdAt: string; - /** - * The ISO 8601 timestamp that the announcement comment was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the user who created this announcement comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the announcement - */ - announcementId: string; - mentions?: Mentions; + /** + * The ID of the announcement comment + */ + id: number; + /** + * The content of the announcement comment + */ + content: string; + /** + * The ISO 8601 timestamp that the announcement comment was created at + */ + createdAt: string; + /** + * The ISO 8601 timestamp that the announcement comment was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the user who created this announcement comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the announcement + */ + announcementId: string; + mentions?: Mentions; }; diff --git a/packages/api/lib/generated/router/models/AnnouncementCommentReaction.ts b/packages/api/lib/generated/router/models/AnnouncementCommentReaction.ts index ac1af930..cc87bd46 100644 --- a/packages/api/lib/generated/router/models/AnnouncementCommentReaction.ts +++ b/packages/api/lib/generated/router/models/AnnouncementCommentReaction.ts @@ -6,21 +6,21 @@ import type { Emote } from "./Emote"; export type AnnouncementCommentReaction = { - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the user who added the reaction - */ - createdBy: string; - emote: Emote; - /** - * The ID of the announcement - */ - announcementId: string; - /** - * The ID of the announcement comment - */ - announcementCommentId: number; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the user who added the reaction + */ + createdBy: string; + emote: Emote; + /** + * The ID of the announcement + */ + announcementId: string; + /** + * The ID of the announcement comment + */ + announcementCommentId: number; }; diff --git a/packages/api/lib/generated/router/models/AnnouncementReaction.ts b/packages/api/lib/generated/router/models/AnnouncementReaction.ts index e3f35bed..0eb5e752 100644 --- a/packages/api/lib/generated/router/models/AnnouncementReaction.ts +++ b/packages/api/lib/generated/router/models/AnnouncementReaction.ts @@ -6,17 +6,17 @@ import type { Emote } from "./Emote"; export type AnnouncementReaction = { - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the user who added the reaction - */ - createdBy: string; - emote: Emote; - /** - * The ID of the announcement - */ - announcementId: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the user who added the reaction + */ + createdBy: string; + emote: Emote; + /** + * The ID of the announcement + */ + announcementId: string; }; diff --git a/packages/api/lib/generated/router/models/CalendarEvent.ts b/packages/api/lib/generated/router/models/CalendarEvent.ts index 91daa186..6097e7b3 100644 --- a/packages/api/lib/generated/router/models/CalendarEvent.ts +++ b/packages/api/lib/generated/router/models/CalendarEvent.ts @@ -6,92 +6,92 @@ import type { Mentions } from "./Mentions"; export type CalendarEvent = { - /** - * The ID of the calendar event - */ - id: number; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The name of the event - */ - name: string; - /** - * The description of the event - */ - description?: string; - /** - * The location of the event - */ - location?: string; - /** - * A URL to associate with the event - */ - url?: string; - /** - * The integer value corresponds to the decimal RGB representation for the color. The color of the event when viewing in the calendar - */ - color?: number; - /** - * Is this event a repeating event - */ - repeats?: boolean; - /** - * The ID of the calendar event series. Only shows if the event is repeating - */ - seriesId?: string; - /** - * The role IDs to restrict the event to - */ - roleIds?: Array; - /** - * When disabled, users will not be able to RSVP to the event - */ - rsvpDisabled?: boolean; - /** - * Does the event last all day - */ - isAllDay?: boolean; - /** - * The number of RSVPs to allow before waitlisting RSVPs - */ - rsvpLimit?: number; - /** - * When `rsvpLimit` is set, users from the waitlist will be added as space becomes available in the event - */ - autofillWaitlist?: boolean; - /** - * The ISO 8601 timestamp that the event starts at - */ - startsAt: string; - /** - * The duration of the event _**in minutes**_ - */ - duration?: number; - isPrivate?: boolean; - mentions?: Mentions; - /** - * The ISO 8601 timestamp that the event was created at - */ - createdAt: string; - /** - * The ID of the user who created this event - */ - createdBy: string; - cancellation?: { - /** - * The description of event cancellation - */ - description?: string; - /** - * The ID of the user who created this event cancellation - */ - createdBy: string; - }; + /** + * The ID of the calendar event + */ + id: number; + /** + * The ID of the server + */ + serverId: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The name of the event + */ + name: string; + /** + * The description of the event + */ + description?: string; + /** + * The location of the event + */ + location?: string; + /** + * A URL to associate with the event + */ + url?: string; + /** + * The integer value corresponds to the decimal RGB representation for the color. The color of the event when viewing in the calendar + */ + color?: number; + /** + * Is this event a repeating event + */ + repeats?: boolean; + /** + * The ID of the calendar event series. Only shows if the event is repeating + */ + seriesId?: string; + /** + * The role IDs to restrict the event to + */ + roleIds?: Array; + /** + * When disabled, users will not be able to RSVP to the event + */ + rsvpDisabled?: boolean; + /** + * Does the event last all day + */ + isAllDay?: boolean; + /** + * The number of RSVPs to allow before waitlisting RSVPs + */ + rsvpLimit?: number; + /** + * When `rsvpLimit` is set, users from the waitlist will be added as space becomes available in the event + */ + autofillWaitlist?: boolean; + /** + * The ISO 8601 timestamp that the event starts at + */ + startsAt: string; + /** + * The duration of the event _**in minutes**_ + */ + duration?: number; + isPrivate?: boolean; + mentions?: Mentions; + /** + * The ISO 8601 timestamp that the event was created at + */ + createdAt: string; + /** + * The ID of the user who created this event + */ + createdBy: string; + cancellation?: { + /** + * The description of event cancellation + */ + description?: string; + /** + * The ID of the user who created this event cancellation + */ + createdBy: string; + }; }; diff --git a/packages/api/lib/generated/router/models/CalendarEventComment.ts b/packages/api/lib/generated/router/models/CalendarEventComment.ts index 54ebce72..588ebdf6 100644 --- a/packages/api/lib/generated/router/models/CalendarEventComment.ts +++ b/packages/api/lib/generated/router/models/CalendarEventComment.ts @@ -6,33 +6,33 @@ import type { Mentions } from "./Mentions"; export type CalendarEventComment = { - /** - * The ID of the calendar event comment - */ - id: number; - /** - * The content of the calendar event comment - */ - content: string; - /** - * The ISO 8601 timestamp that the calendar event comment was created at - */ - createdAt: string; - /** - * The ISO 8601 timestamp that the calendar event comment was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the calendar event - */ - calendarEventId: number; - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the user who created this calendar event comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - mentions?: Mentions; + /** + * The ID of the calendar event comment + */ + id: number; + /** + * The content of the calendar event comment + */ + content: string; + /** + * The ISO 8601 timestamp that the calendar event comment was created at + */ + createdAt: string; + /** + * The ISO 8601 timestamp that the calendar event comment was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the calendar event + */ + calendarEventId: number; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the user who created this calendar event comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + mentions?: Mentions; }; diff --git a/packages/api/lib/generated/router/models/CalendarEventCommentReaction.ts b/packages/api/lib/generated/router/models/CalendarEventCommentReaction.ts index 4214f605..6f04f1a5 100644 --- a/packages/api/lib/generated/router/models/CalendarEventCommentReaction.ts +++ b/packages/api/lib/generated/router/models/CalendarEventCommentReaction.ts @@ -6,21 +6,21 @@ import type { Emote } from "./Emote"; export type CalendarEventCommentReaction = { - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the user who added the reaction - */ - createdBy: string; - emote: Emote; - /** - * The ID of the calendar event - */ - calendarEventId: number; - /** - * The ID of the calendar event comment - */ - calendarEventCommentId: number; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the user who added the reaction + */ + createdBy: string; + emote: Emote; + /** + * The ID of the calendar event + */ + calendarEventId: number; + /** + * The ID of the calendar event comment + */ + calendarEventCommentId: number; }; diff --git a/packages/api/lib/generated/router/models/CalendarEventReaction.ts b/packages/api/lib/generated/router/models/CalendarEventReaction.ts index ea80c95b..55a241f0 100644 --- a/packages/api/lib/generated/router/models/CalendarEventReaction.ts +++ b/packages/api/lib/generated/router/models/CalendarEventReaction.ts @@ -6,17 +6,17 @@ import type { Emote } from "./Emote"; export type CalendarEventReaction = { - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the user who added the reaction - */ - createdBy: string; - emote: Emote; - /** - * The ID of the calendar event - */ - calendarEventId: number; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the user who added the reaction + */ + createdBy: string; + emote: Emote; + /** + * The ID of the calendar event + */ + calendarEventId: number; }; diff --git a/packages/api/lib/generated/router/models/CalendarEventRsvp.ts b/packages/api/lib/generated/router/models/CalendarEventRsvp.ts index d799fcd1..4790654f 100644 --- a/packages/api/lib/generated/router/models/CalendarEventRsvp.ts +++ b/packages/api/lib/generated/router/models/CalendarEventRsvp.ts @@ -4,40 +4,46 @@ /* eslint-disable */ export type CalendarEventRsvp = { - /** - * The ID of the calendar event - */ - calendarEventId: number; - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the user - */ - userId: string; - /** - * The status of the RSVP - */ - status: "going" | "maybe" | "declined" | "invited" | "waitlisted" | "not responded"; - /** - * The ID of the user who created this RSVP - */ - createdBy: string; - /** - * The ISO 8601 timestamp that the RSVP was created at - */ - createdAt: string; - /** - * The ID of the user who updated this RSVP - */ - updatedBy?: string; - /** - * The ISO 8601 timestamp that the RSVP was updated at, if relevant - */ - updatedAt?: string; + /** + * The ID of the calendar event + */ + calendarEventId: number; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the server + */ + serverId: string; + /** + * The ID of the user + */ + userId: string; + /** + * The status of the RSVP + */ + status: + | "going" + | "maybe" + | "declined" + | "invited" + | "waitlisted" + | "not responded"; + /** + * The ID of the user who created this RSVP + */ + createdBy: string; + /** + * The ISO 8601 timestamp that the RSVP was created at + */ + createdAt: string; + /** + * The ID of the user who updated this RSVP + */ + updatedBy?: string; + /** + * The ISO 8601 timestamp that the RSVP was updated at, if relevant + */ + updatedAt?: string; }; diff --git a/packages/api/lib/generated/router/models/CalendarEventSeries.ts b/packages/api/lib/generated/router/models/CalendarEventSeries.ts index 7440a3b8..88ff6e0f 100644 --- a/packages/api/lib/generated/router/models/CalendarEventSeries.ts +++ b/packages/api/lib/generated/router/models/CalendarEventSeries.ts @@ -4,16 +4,16 @@ /* eslint-disable */ export type CalendarEventSeries = { - /** - * The ID of the calendar event series - */ - id: string; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the channel - */ - channelId: string; + /** + * The ID of the calendar event series + */ + id: string; + /** + * The ID of the server + */ + serverId: string; + /** + * The ID of the channel + */ + channelId: string; }; diff --git a/packages/api/lib/generated/router/models/Category.ts b/packages/api/lib/generated/router/models/Category.ts index aaf1e1d1..83b66ef5 100644 --- a/packages/api/lib/generated/router/models/Category.ts +++ b/packages/api/lib/generated/router/models/Category.ts @@ -4,28 +4,28 @@ /* eslint-disable */ export type Category = { - /** - * The ID of the category - */ - id: number; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the group - */ - groupId: string; - /** - * The ISO 8601 timestamp that the category was created at - */ - createdAt: string; - /** - * The ISO 8601 timestamp that the category was updated at, if relevant - */ - updatedAt?: string; - /** - * Name of the category - */ - name: string; + /** + * The ID of the category + */ + id: number; + /** + * The ID of the server + */ + serverId: string; + /** + * The ID of the group + */ + groupId: string; + /** + * The ISO 8601 timestamp that the category was created at + */ + createdAt: string; + /** + * The ISO 8601 timestamp that the category was updated at, if relevant + */ + updatedAt?: string; + /** + * Name of the category + */ + name: string; }; diff --git a/packages/api/lib/generated/router/models/ChatEmbed.ts b/packages/api/lib/generated/router/models/ChatEmbed.ts index 4dbc82c6..cb6dc61f 100644 --- a/packages/api/lib/generated/router/models/ChatEmbed.ts +++ b/packages/api/lib/generated/router/models/ChatEmbed.ts @@ -7,89 +7,89 @@ * Rich content sections optionally associated with chat messages. Properties with "webhook-markdown" support allow for the following: link, italic, bold, strikethrough, underline, inline code, block code, reaction, and mention. */ export type ChatEmbed = { - /** - * Main header of the embed - */ - title?: string; - /** - * Subtext of the embed - */ - description?: string; - /** - * URL to linkify the `title` field with - */ - url?: string; - /** - * The integer value corresponds to the decimal RGB representation for the color. The color that the left border should be - */ - color?: number; - /** - * A small section at the bottom of the embed - */ - footer?: { - /** - * URL of a small image to put in the footer - */ - icon_url?: string; - /** - * Text of the footer - */ - text: string; - }; - /** - * A timestamp to put in the footer - */ - timestamp?: string; - /** - * An image to the right of the embed's content - */ - thumbnail?: { - /** - * URL of the image - */ - url?: string; - }; - /** - * The main picture to associate with the embed - */ - image?: { - /** - * URL of the image - */ - url?: string; - }; - /** - * A small section above the title of the embed - */ - author?: { - /** - * Name of the author - */ - name?: string; - /** - * URL to linkify the author's `name` field - */ - url?: string; - /** - * URL of a small image to display to the left of the author's `name` - */ - icon_url?: string; - }; - /** - * Table-like cells to add to the embed - */ - fields?: Array<{ - /** - * Header of the table-like cell - */ - name: string; - /** - * Subtext of the table-like cell - */ - value: string; - /** - * If the field should wrap or not - */ - inline?: boolean; - }>; + /** + * Main header of the embed + */ + title?: string; + /** + * Subtext of the embed + */ + description?: string; + /** + * URL to linkify the `title` field with + */ + url?: string; + /** + * The integer value corresponds to the decimal RGB representation for the color. The color that the left border should be + */ + color?: number; + /** + * A small section at the bottom of the embed + */ + footer?: { + /** + * URL of a small image to put in the footer + */ + icon_url?: string; + /** + * Text of the footer + */ + text: string; + }; + /** + * A timestamp to put in the footer + */ + timestamp?: string; + /** + * An image to the right of the embed's content + */ + thumbnail?: { + /** + * URL of the image + */ + url?: string; + }; + /** + * The main picture to associate with the embed + */ + image?: { + /** + * URL of the image + */ + url?: string; + }; + /** + * A small section above the title of the embed + */ + author?: { + /** + * Name of the author + */ + name?: string; + /** + * URL to linkify the author's `name` field + */ + url?: string; + /** + * URL of a small image to display to the left of the author's `name` + */ + icon_url?: string; + }; + /** + * Table-like cells to add to the embed + */ + fields?: Array<{ + /** + * Header of the table-like cell + */ + name: string; + /** + * Subtext of the table-like cell + */ + value: string; + /** + * If the field should wrap or not + */ + inline?: boolean; + }>; }; diff --git a/packages/api/lib/generated/router/models/ChatMessage.ts b/packages/api/lib/generated/router/models/ChatMessage.ts index 0b3d9a97..06effdd7 100644 --- a/packages/api/lib/generated/router/models/ChatMessage.ts +++ b/packages/api/lib/generated/router/models/ChatMessage.ts @@ -7,59 +7,61 @@ import type { ChatEmbed } from "./ChatEmbed"; import type { Mentions } from "./Mentions"; export type ChatMessage = { - /** - * The ID of the message - */ - id: string; - /** - * The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated. - */ - type: "default" | "system"; - /** - * The ID of the server - */ - serverId?: string; - /** - * The ID of the group - */ - groupId?: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The content of the message - */ - content?: string; - embeds?: Array; - /** - * Message IDs that were replied to - */ - replyMessageIds?: Array; - /** - * If set, this message will only be seen by those mentioned or replied to - */ - isPrivate?: boolean; - /** - * If set, this message did not notify mention or reply recipients - */ - isSilent?: boolean; - isPinned?: boolean; - mentions?: Mentions; - /** - * The ISO 8601 timestamp that the message was created at - */ - createdAt: string; - /** - * The ID of the user who created this message (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * The ID of the webhook who created this message, if it was created by a webhook - */ - createdByWebhookId?: string; - /** - * The ISO 8601 timestamp that the message was updated at, if relevant - */ - updatedAt?: string; + /** + * The ID of the message + */ + id: string; + /** + * The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated. + */ + type: + | "default" + | "system"; + /** + * The ID of the server + */ + serverId?: string; + /** + * The ID of the group + */ + groupId?: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The content of the message + */ + content?: string; + embeds?: Array; + /** + * Message IDs that were replied to + */ + replyMessageIds?: Array; + /** + * If set, this message will only be seen by those mentioned or replied to + */ + isPrivate?: boolean; + /** + * If set, this message did not notify mention or reply recipients + */ + isSilent?: boolean; + isPinned?: boolean; + mentions?: Mentions; + /** + * The ISO 8601 timestamp that the message was created at + */ + createdAt: string; + /** + * The ID of the user who created this message (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * The ID of the webhook who created this message, if it was created by a webhook + */ + createdByWebhookId?: string; + /** + * The ISO 8601 timestamp that the message was updated at, if relevant + */ + updatedAt?: string; }; diff --git a/packages/api/lib/generated/router/models/ChatMessageReaction.ts b/packages/api/lib/generated/router/models/ChatMessageReaction.ts index 3b2db99b..5a82d582 100644 --- a/packages/api/lib/generated/router/models/ChatMessageReaction.ts +++ b/packages/api/lib/generated/router/models/ChatMessageReaction.ts @@ -6,17 +6,17 @@ import type { Emote } from "./Emote"; export type ChatMessageReaction = { - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the user who added the reaction - */ - createdBy: string; - emote: Emote; - /** - * The ID of the message - */ - messageId: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the user who added the reaction + */ + createdBy: string; + emote: Emote; + /** + * The ID of the message + */ + messageId: string; }; diff --git a/packages/api/lib/generated/router/models/Doc.ts b/packages/api/lib/generated/router/models/Doc.ts index 6c21b2ac..e72719dd 100644 --- a/packages/api/lib/generated/router/models/Doc.ts +++ b/packages/api/lib/generated/router/models/Doc.ts @@ -6,41 +6,41 @@ import type { Mentions } from "./Mentions"; export type Doc = { - /** - * The ID of the doc - */ - id: number; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The title of the doc - */ - title: string; - /** - * The content of the doc - */ - content: string; - mentions?: Mentions; - /** - * The ISO 8601 timestamp that the doc was created at - */ - createdAt: string; - /** - * The ID of the user who created this doc - */ - createdBy: string; - /** - * The ISO 8601 timestamp that the doc was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the user who updated this doc - */ - updatedBy?: string; + /** + * The ID of the doc + */ + id: number; + /** + * The ID of the server + */ + serverId: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The title of the doc + */ + title: string; + /** + * The content of the doc + */ + content: string; + mentions?: Mentions; + /** + * The ISO 8601 timestamp that the doc was created at + */ + createdAt: string; + /** + * The ID of the user who created this doc + */ + createdBy: string; + /** + * The ISO 8601 timestamp that the doc was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the user who updated this doc + */ + updatedBy?: string; }; diff --git a/packages/api/lib/generated/router/models/DocComment.ts b/packages/api/lib/generated/router/models/DocComment.ts index 9991ef20..9b0eaa24 100644 --- a/packages/api/lib/generated/router/models/DocComment.ts +++ b/packages/api/lib/generated/router/models/DocComment.ts @@ -6,33 +6,33 @@ import type { Mentions } from "./Mentions"; export type DocComment = { - /** - * The ID of the doc comment - */ - id: number; - /** - * The content of the doc comment - */ - content: string; - /** - * The ISO 8601 timestamp that the doc comment was created at - */ - createdAt: string; - /** - * The ID of the user who created this doc comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * The ISO 8601 timestamp that the doc comment was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the doc - */ - docId: number; - mentions?: Mentions; + /** + * The ID of the doc comment + */ + id: number; + /** + * The content of the doc comment + */ + content: string; + /** + * The ISO 8601 timestamp that the doc comment was created at + */ + createdAt: string; + /** + * The ID of the user who created this doc comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * The ISO 8601 timestamp that the doc comment was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the doc + */ + docId: number; + mentions?: Mentions; }; diff --git a/packages/api/lib/generated/router/models/DocCommentReaction.ts b/packages/api/lib/generated/router/models/DocCommentReaction.ts index 7a4b6ab5..19cfa7e8 100644 --- a/packages/api/lib/generated/router/models/DocCommentReaction.ts +++ b/packages/api/lib/generated/router/models/DocCommentReaction.ts @@ -6,21 +6,21 @@ import type { Emote } from "./Emote"; export type DocCommentReaction = { - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the user who added the reaction - */ - createdBy: string; - emote: Emote; - /** - * The ID of the doc - */ - docId: number; - /** - * The ID of the doc comment - */ - docCommentId: number; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the user who added the reaction + */ + createdBy: string; + emote: Emote; + /** + * The ID of the doc + */ + docId: number; + /** + * The ID of the doc comment + */ + docCommentId: number; }; diff --git a/packages/api/lib/generated/router/models/DocReaction.ts b/packages/api/lib/generated/router/models/DocReaction.ts index b9d2ec96..ba20fcf3 100644 --- a/packages/api/lib/generated/router/models/DocReaction.ts +++ b/packages/api/lib/generated/router/models/DocReaction.ts @@ -6,17 +6,17 @@ import type { Emote } from "./Emote"; export type DocReaction = { - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the user who added the reaction - */ - createdBy: string; - emote: Emote; - /** - * The ID of the doc - */ - docId: number; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the user who added the reaction + */ + createdBy: string; + emote: Emote; + /** + * The ID of the doc + */ + docId: number; }; diff --git a/packages/api/lib/generated/router/models/Emote.ts b/packages/api/lib/generated/router/models/Emote.ts index c008394b..9fbdf056 100644 --- a/packages/api/lib/generated/router/models/Emote.ts +++ b/packages/api/lib/generated/router/models/Emote.ts @@ -4,20 +4,20 @@ /* eslint-disable */ export type Emote = { - /** - * The ID of the emote - */ - id: number; - /** - * The name of the emote - */ - name: string; - /** - * The URL of the emote image - */ - url: string; - /** - * The ID of the server the emote was created on - */ - serverId?: string; + /** + * The ID of the emote + */ + id: number; + /** + * The name of the emote + */ + name: string; + /** + * The URL of the emote image + */ + url: string; + /** + * The ID of the server the emote was created on + */ + serverId?: string; }; diff --git a/packages/api/lib/generated/router/models/ForumTopic.ts b/packages/api/lib/generated/router/models/ForumTopic.ts index 246b7a2d..ef009af7 100644 --- a/packages/api/lib/generated/router/models/ForumTopic.ts +++ b/packages/api/lib/generated/router/models/ForumTopic.ts @@ -6,43 +6,43 @@ import type { Mentions } from "./Mentions"; export type ForumTopic = { - /** - * The ID of the forum topic - */ - id: number; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The title of the forum topic - */ - title: string; - /** - * The ISO 8601 timestamp that the forum topic was created at - */ - createdAt: string; - /** - * The ID of the user who created this forum topic (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * The ISO 8601 timestamp that the forum topic was updated at, if relevant - */ - updatedAt?: string; - /** - * The ISO 8601 timestamp that the forum topic was bumped at. This timestamp is updated whenever there is any activity on the posts within the forum topic. - */ - bumpedAt?: string; - isPinned?: boolean; - isLocked?: boolean; - /** - * The content of the forum topic - */ - content: string; - mentions?: Mentions; + /** + * The ID of the forum topic + */ + id: number; + /** + * The ID of the server + */ + serverId: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The title of the forum topic + */ + title: string; + /** + * The ISO 8601 timestamp that the forum topic was created at + */ + createdAt: string; + /** + * The ID of the user who created this forum topic (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * The ISO 8601 timestamp that the forum topic was updated at, if relevant + */ + updatedAt?: string; + /** + * The ISO 8601 timestamp that the forum topic was bumped at. This timestamp is updated whenever there is any activity on the posts within the forum topic. + */ + bumpedAt?: string; + isPinned?: boolean; + isLocked?: boolean; + /** + * The content of the forum topic + */ + content: string; + mentions?: Mentions; }; diff --git a/packages/api/lib/generated/router/models/ForumTopicComment.ts b/packages/api/lib/generated/router/models/ForumTopicComment.ts index ec96fc9c..a05d3def 100644 --- a/packages/api/lib/generated/router/models/ForumTopicComment.ts +++ b/packages/api/lib/generated/router/models/ForumTopicComment.ts @@ -6,33 +6,33 @@ import type { Mentions } from "./Mentions"; export type ForumTopicComment = { - /** - * The ID of the forum topic comment - */ - id: number; - /** - * The content of the forum topic comment - */ - content: string; - /** - * The ISO 8601 timestamp that the forum topic comment was created at - */ - createdAt: string; - /** - * The ISO 8601 timestamp that the forum topic comment was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the forum topic - */ - forumTopicId: number; - /** - * The ID of the user who created this forum topic comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - mentions?: Mentions; + /** + * The ID of the forum topic comment + */ + id: number; + /** + * The content of the forum topic comment + */ + content: string; + /** + * The ISO 8601 timestamp that the forum topic comment was created at + */ + createdAt: string; + /** + * The ISO 8601 timestamp that the forum topic comment was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the forum topic + */ + forumTopicId: number; + /** + * The ID of the user who created this forum topic comment (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + mentions?: Mentions; }; diff --git a/packages/api/lib/generated/router/models/ForumTopicCommentReaction.ts b/packages/api/lib/generated/router/models/ForumTopicCommentReaction.ts index de7d0e6d..6c8db78e 100644 --- a/packages/api/lib/generated/router/models/ForumTopicCommentReaction.ts +++ b/packages/api/lib/generated/router/models/ForumTopicCommentReaction.ts @@ -6,21 +6,21 @@ import type { Emote } from "./Emote"; export type ForumTopicCommentReaction = { - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the user who added the reaction - */ - createdBy: string; - emote: Emote; - /** - * The ID of the forum topic - */ - forumTopicId: number; - /** - * The ID of the forum topic comment - */ - forumTopicCommentId: number; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the user who added the reaction + */ + createdBy: string; + emote: Emote; + /** + * The ID of the forum topic + */ + forumTopicId: number; + /** + * The ID of the forum topic comment + */ + forumTopicCommentId: number; }; diff --git a/packages/api/lib/generated/router/models/ForumTopicReaction.ts b/packages/api/lib/generated/router/models/ForumTopicReaction.ts index 08b55224..572a1744 100644 --- a/packages/api/lib/generated/router/models/ForumTopicReaction.ts +++ b/packages/api/lib/generated/router/models/ForumTopicReaction.ts @@ -6,17 +6,17 @@ import type { Emote } from "./Emote"; export type ForumTopicReaction = { - /** - * The ID of the channel - */ - channelId: string; - /** - * The ID of the user who added the reaction - */ - createdBy: string; - emote: Emote; - /** - * The ID of the forum topic - */ - forumTopicId: number; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ID of the user who added the reaction + */ + createdBy: string; + emote: Emote; + /** + * The ID of the forum topic + */ + forumTopicId: number; }; diff --git a/packages/api/lib/generated/router/models/ForumTopicSummary.ts b/packages/api/lib/generated/router/models/ForumTopicSummary.ts index 58a30309..9059069a 100644 --- a/packages/api/lib/generated/router/models/ForumTopicSummary.ts +++ b/packages/api/lib/generated/router/models/ForumTopicSummary.ts @@ -4,38 +4,38 @@ /* eslint-disable */ export type ForumTopicSummary = { - /** - * The ID of the forum topic - */ - id: number; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The title of the forum topic - */ - title: string; - /** - * The ISO 8601 timestamp that the forum topic was created at - */ - createdAt: string; - /** - * The ID of the user who created this forum topic (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * The ISO 8601 timestamp that the forum topic was updated at, if relevant - */ - updatedAt?: string; - /** - * The ISO 8601 timestamp that the forum topic was bumped at. This timestamp is updated whenever there is any activity on the posts within the forum topic. - */ - bumpedAt?: string; - isPinned?: boolean; - isLocked?: boolean; + /** + * The ID of the forum topic + */ + id: number; + /** + * The ID of the server + */ + serverId: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The title of the forum topic + */ + title: string; + /** + * The ISO 8601 timestamp that the forum topic was created at + */ + createdAt: string; + /** + * The ID of the user who created this forum topic (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * The ISO 8601 timestamp that the forum topic was updated at, if relevant + */ + updatedAt?: string; + /** + * The ISO 8601 timestamp that the forum topic was bumped at. This timestamp is updated whenever there is any activity on the posts within the forum topic. + */ + bumpedAt?: string; + isPinned?: boolean; + isLocked?: boolean; }; diff --git a/packages/api/lib/generated/router/models/Group.ts b/packages/api/lib/generated/router/models/Group.ts index 1254e3eb..bb5a9c17 100644 --- a/packages/api/lib/generated/router/models/Group.ts +++ b/packages/api/lib/generated/router/models/Group.ts @@ -4,60 +4,60 @@ /* eslint-disable */ export type Group = { - /** - * The ID of the group - */ - id: string; - /** - * The ID of the server - */ - serverId: string; - /** - * The name of the group - */ - name: string; - /** - * The description associated with the group - */ - description?: string; - /** - * The avatar image associated with the group - */ - avatar?: string; - /** - * If `true`, this is the server's home group - */ - isHome?: boolean; - /** - * The emote to associate with the group - */ - emoteId?: number; - /** - * Is this group open for anyone to join? - */ - isPublic?: boolean; - /** - * The ISO 8601 timestamp that the group was created at - */ - createdAt: string; - /** - * The ID of the user who created this group - */ - createdBy: string; - /** - * The ISO 8601 timestamp that the group was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the user who updated this group - */ - updatedBy?: string; - /** - * The ISO 8601 timestamp that the group was archived at, if relevant - */ - archivedAt?: string; - /** - * The ID of the user who archived this group - */ - archivedBy?: string; + /** + * The ID of the group + */ + id: string; + /** + * The ID of the server + */ + serverId: string; + /** + * The name of the group + */ + name: string; + /** + * The description associated with the group + */ + description?: string; + /** + * The avatar image associated with the group + */ + avatar?: string; + /** + * If `true`, this is the server's home group + */ + isHome?: boolean; + /** + * The emote to associate with the group + */ + emoteId?: number; + /** + * Is this group open for anyone to join? + */ + isPublic?: boolean; + /** + * The ISO 8601 timestamp that the group was created at + */ + createdAt: string; + /** + * The ID of the user who created this group + */ + createdBy: string; + /** + * The ISO 8601 timestamp that the group was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the user who updated this group + */ + updatedBy?: string; + /** + * The ISO 8601 timestamp that the group was archived at, if relevant + */ + archivedAt?: string; + /** + * The ID of the user who archived this group + */ + archivedBy?: string; }; diff --git a/packages/api/lib/generated/router/models/ListItem.ts b/packages/api/lib/generated/router/models/ListItem.ts index 7cd07d7d..226aa8a7 100644 --- a/packages/api/lib/generated/router/models/ListItem.ts +++ b/packages/api/lib/generated/router/models/ListItem.ts @@ -6,76 +6,76 @@ import type { Mentions } from "./Mentions"; export type ListItem = { - /** - * The ID of the list item - */ - id: string; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The message of the list item - */ - message: string; - mentions?: Mentions; - /** - * The ISO 8601 timestamp that the list item was created at - */ - createdAt: string; - /** - * The ID of the user who created this list item (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * The ID of the webhook who created this list item, if it was created by a webhook - */ - createdByWebhookId?: string; - /** - * The ISO 8601 timestamp that the list item was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the user who updated this list item - */ - updatedBy?: string; - /** - * The ID of the parent list item if this list item is nested - */ - parentListItemId?: string; - /** - * The ISO 8601 timestamp that the list item was completed at - */ - completedAt?: string; - /** - * The ID of the user who completed this list item - */ - completedBy?: string; - note?: { - /** - * The ISO 8601 timestamp that the note was created at. If this field is populated, then there's a note associated with the list item - */ - createdAt: string; - /** - * The ID of the user who created this note - */ - createdBy: string; - /** - * The ISO 8601 timestamp that the note was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the user who updated this note - */ - updatedBy?: string; - mentions?: Mentions; - /** - * The note of the list item - */ - content: string; - }; + /** + * The ID of the list item + */ + id: string; + /** + * The ID of the server + */ + serverId: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The message of the list item + */ + message: string; + mentions?: Mentions; + /** + * The ISO 8601 timestamp that the list item was created at + */ + createdAt: string; + /** + * The ID of the user who created this list item (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * The ID of the webhook who created this list item, if it was created by a webhook + */ + createdByWebhookId?: string; + /** + * The ISO 8601 timestamp that the list item was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the user who updated this list item + */ + updatedBy?: string; + /** + * The ID of the parent list item if this list item is nested + */ + parentListItemId?: string; + /** + * The ISO 8601 timestamp that the list item was completed at + */ + completedAt?: string; + /** + * The ID of the user who completed this list item + */ + completedBy?: string; + note?: { + /** + * The ISO 8601 timestamp that the note was created at. If this field is populated, then there's a note associated with the list item + */ + createdAt: string; + /** + * The ID of the user who created this note + */ + createdBy: string; + /** + * The ISO 8601 timestamp that the note was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the user who updated this note + */ + updatedBy?: string; + mentions?: Mentions; + /** + * The note of the list item + */ + content: string; + }; }; diff --git a/packages/api/lib/generated/router/models/ListItemSummary.ts b/packages/api/lib/generated/router/models/ListItemSummary.ts index 15867755..14a36d38 100644 --- a/packages/api/lib/generated/router/models/ListItemSummary.ts +++ b/packages/api/lib/generated/router/models/ListItemSummary.ts @@ -6,71 +6,71 @@ import type { Mentions } from "./Mentions"; export type ListItemSummary = { - /** - * The ID of the list item - */ - id: string; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The message of the list item - */ - message: string; - mentions?: Mentions; - /** - * The ISO 8601 timestamp that the list item was created at - */ - createdAt: string; - /** - * The ID of the user who created this list item (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy: string; - /** - * The ID of the webhook who created this list item, if it was created by a webhook - */ - createdByWebhookId?: string; - /** - * The ISO 8601 timestamp that the list item was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the user who updated this list item - */ - updatedBy?: string; - /** - * The ID of the parent list item if this list item is nested - */ - parentListItemId?: string; - /** - * The ISO 8601 timestamp that the list item was completed at - */ - completedAt?: string; - /** - * The ID of the user who completed this list item - */ - completedBy?: string; - note?: { - /** - * The ISO 8601 timestamp that the note was created at. If this field is populated, then there's a note associated with the list item - */ - createdAt: string; - /** - * The ID of the user who created this note - */ - createdBy: string; - /** - * The ISO 8601 timestamp that the note was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the user who updated this note - */ - updatedBy?: string; - }; + /** + * The ID of the list item + */ + id: string; + /** + * The ID of the server + */ + serverId: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The message of the list item + */ + message: string; + mentions?: Mentions; + /** + * The ISO 8601 timestamp that the list item was created at + */ + createdAt: string; + /** + * The ID of the user who created this list item (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy: string; + /** + * The ID of the webhook who created this list item, if it was created by a webhook + */ + createdByWebhookId?: string; + /** + * The ISO 8601 timestamp that the list item was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the user who updated this list item + */ + updatedBy?: string; + /** + * The ID of the parent list item if this list item is nested + */ + parentListItemId?: string; + /** + * The ISO 8601 timestamp that the list item was completed at + */ + completedAt?: string; + /** + * The ID of the user who completed this list item + */ + completedBy?: string; + note?: { + /** + * The ISO 8601 timestamp that the note was created at. If this field is populated, then there's a note associated with the list item + */ + createdAt: string; + /** + * The ID of the user who created this note + */ + createdBy: string; + /** + * The ISO 8601 timestamp that the note was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the user who updated this note + */ + updatedBy?: string; + }; }; diff --git a/packages/api/lib/generated/router/models/Mentions.ts b/packages/api/lib/generated/router/models/Mentions.ts index 3968a3aa..957678d0 100644 --- a/packages/api/lib/generated/router/models/Mentions.ts +++ b/packages/api/lib/generated/router/models/Mentions.ts @@ -7,39 +7,39 @@ * Metadata of who or what is mentioned in content */ export type Mentions = { - /** - * Info on mentioned users - */ - users?: Array<{ - /** - * The ID of the user - */ - id: string; - }>; - /** - * Info on mentioned channels - */ - channels?: Array<{ - /** - * The ID of the channel - */ - id: string; - }>; - /** - * Info on mentioned roles - */ - roles?: Array<{ - /** - * The ID of the role - */ - id: number; - }>; - /** - * If @everyone was mentioned - */ - everyone?: boolean; - /** - * If @here was mentioned - */ - here?: boolean; + /** + * Info on mentioned users + */ + users?: Array<{ + /** + * The ID of the user + */ + id: string; + }>; + /** + * Info on mentioned channels + */ + channels?: Array<{ + /** + * The ID of the channel + */ + id: string; + }>; + /** + * Info on mentioned roles + */ + roles?: Array<{ + /** + * The ID of the role + */ + id: number; + }>; + /** + * If @everyone was mentioned + */ + everyone?: boolean; + /** + * If @here was mentioned + */ + here?: boolean; }; diff --git a/packages/api/lib/generated/router/models/Role.ts b/packages/api/lib/generated/router/models/Role.ts index 78bbd9f9..71f9f6cc 100644 --- a/packages/api/lib/generated/router/models/Role.ts +++ b/packages/api/lib/generated/router/models/Role.ts @@ -4,60 +4,60 @@ /* eslint-disable */ export type Role = { - /** - * The ID of the role - */ - id: number; - /** - * The ID of the server - */ - serverId: string; - /** - * The ISO 8601 timestamp that the role was created at - */ - createdAt: string; - /** - * The ISO 8601 timestamp that the role was updated at, if relevant - */ - updatedAt?: string; - /** - * The role's name - */ - name: string; - /** - * If set, the role will be displayed separately in the channel member list - */ - isDisplayedSeparately?: boolean; - /** - * If set, this roll will be self assigned - */ - isSelfAssignable?: boolean; - /** - * If set, this role can be mentioned - */ - isMentionable?: boolean; - /** - * Permissions must be a collection of valid permissions as defined in the [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) section - */ - permissions: Array; - /** - * An array of integer values corresponding to the decimal RGB representation for a color. The first color is solid, and a second color indicates a gradient - */ - colors?: Array; - /** - * The URL of the role icon - */ - icon?: string; - /** - * The position the role will be in relation to the roles in the server - */ - position: number; - /** - * The default role users are given when joining the server. Base roles are tied directly to the server and cannot be created or deleted - */ - isBase?: boolean; - /** - * The bot user ID this role has been defined for. Roles with this populated can only be deleted by kicking the bot - */ - botUserId?: string; + /** + * The ID of the role + */ + id: number; + /** + * The ID of the server + */ + serverId: string; + /** + * The ISO 8601 timestamp that the role was created at + */ + createdAt: string; + /** + * The ISO 8601 timestamp that the role was updated at, if relevant + */ + updatedAt?: string; + /** + * The role's name + */ + name: string; + /** + * If set, the role will be displayed separately in the channel member list + */ + isDisplayedSeparately?: boolean; + /** + * If set, this roll will be self assigned + */ + isSelfAssignable?: boolean; + /** + * If set, this role can be mentioned + */ + isMentionable?: boolean; + /** + * Permissions must be a collection of valid permissions as defined in the [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) section + */ + permissions: Array; + /** + * An array of integer values corresponding to the decimal RGB representation for a color. The first color is solid, and a second color indicates a gradient + */ + colors?: Array; + /** + * The URL of the role icon + */ + icon?: string; + /** + * The position the role will be in relation to the roles in the server + */ + position: number; + /** + * The default role users are given when joining the server. Base roles are tied directly to the server and cannot be created or deleted + */ + isBase?: boolean; + /** + * The bot user ID this role has been defined for. Roles with this populated can only be deleted by kicking the bot + */ + botUserId?: string; }; diff --git a/packages/api/lib/generated/router/models/Server.ts b/packages/api/lib/generated/router/models/Server.ts index 17853fd4..15fe96a5 100644 --- a/packages/api/lib/generated/router/models/Server.ts +++ b/packages/api/lib/generated/router/models/Server.ts @@ -4,52 +4,60 @@ /* eslint-disable */ export type Server = { - /** - * The ID of the server - */ - id: string; - /** - * The ID of the user who created this server - */ - ownerId: string; - /** - * The type of server designated from the server's settings page - */ - type?: "team" | "organization" | "community" | "clan" | "guild" | "friends" | "streaming" | "other"; - /** - * The name given to the server - */ - name: string; - /** - * The URL that the server can be accessible from. For example, a value of "Guilded-Official" means the server can be accessible from https://www.guilded.gg/Guilded-Official - */ - url?: string; - /** - * The description associated with the server - */ - about?: string; - /** - * The avatar image associated with the server - */ - avatar?: string; - /** - * The banner image associated with the server - */ - banner?: string; - /** - * The timezone associated with the server - */ - timezone?: string; - /** - * The verified status of the server - */ - isVerified?: boolean; - /** - * The channel ID of the default channel of the server. This channel is defined as the first chat or voice channel in the left sidebar of a server in our UI. This channel is useful for sending welcome messages, though note that a bot may not have permissions to interact with this channel depending on how the server is configured. - */ - defaultChannelId?: string; - /** - * The ISO 8601 timestamp that the server was created at - */ - createdAt: string; + /** + * The ID of the server + */ + id: string; + /** + * The ID of the user who created this server + */ + ownerId: string; + /** + * The type of server designated from the server's settings page + */ + type?: + | "team" + | "organization" + | "community" + | "clan" + | "guild" + | "friends" + | "streaming" + | "other"; + /** + * The name given to the server + */ + name: string; + /** + * The URL that the server can be accessible from. For example, a value of "Guilded-Official" means the server can be accessible from https://www.guilded.gg/Guilded-Official + */ + url?: string; + /** + * The description associated with the server + */ + about?: string; + /** + * The avatar image associated with the server + */ + avatar?: string; + /** + * The banner image associated with the server + */ + banner?: string; + /** + * The timezone associated with the server + */ + timezone?: string; + /** + * The verified status of the server + */ + isVerified?: boolean; + /** + * The channel ID of the default channel of the server. This channel is defined as the first chat or voice channel in the left sidebar of a server in our UI. This channel is useful for sending welcome messages, though note that a bot may not have permissions to interact with this channel depending on how the server is configured. + */ + defaultChannelId?: string; + /** + * The ISO 8601 timestamp that the server was created at + */ + createdAt: string; }; diff --git a/packages/api/lib/generated/router/models/ServerChannel.ts b/packages/api/lib/generated/router/models/ServerChannel.ts index 1751d68d..1d10e8c7 100644 --- a/packages/api/lib/generated/router/models/ServerChannel.ts +++ b/packages/api/lib/generated/router/models/ServerChannel.ts @@ -4,72 +4,85 @@ /* eslint-disable */ export type ServerChannel = { - /** - * The ID of the channel - */ - id: string; - /** - * The type of channel. This will determine what routes to use for creating content in a channel. For example, if this "chat", then one must use the routes for creating channel messages - */ - type: "announcements" | "chat" | "calendar" | "forums" | "media" | "docs" | "voice" | "list" | "scheduling" | "stream"; - /** - * The name of the channel - */ - name: string; - /** - * The topic of the channel. Not applicable to threads - */ - topic?: string; - /** - * The ISO 8601 timestamp that the channel was created at - */ - createdAt: string; - /** - * The ID of the user who created this channel - */ - createdBy: string; - /** - * The ISO 8601 timestamp that the channel was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the server - */ - serverId: string; - /** - * ID of the **root** channel or thread in the channel hierarchy. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present - */ - rootId?: string; - /** - * ID of the **immediate** parent channel or thread in the channel hierarchy. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present - */ - parentId?: string; - /** - * The ID of the message that this channel was created off of. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present - */ - messageId?: string; - /** - * The category that the channel exists in. Only relevant for server channels - */ - categoryId?: number; - /** - * The ID of the group - */ - groupId: string; - /** - * What users can access the channel. Only applicable to server channels. If not present, this channel will respect normal permissions. `public` is accessible to everyone, even those who aren't of the server. `private` is only accessible to explicitly mentioned users. Currently, threads cannot be `public` and other channels cannot be `private`. Additionally, `private` threads can only exist with an associated `messageId` that is for a private message - */ - visibility?: "private" | "public" | null; - /** - * [DEPRECATED - use `visibility` instead] Whether the channel can be accessed from users who are not member of the server. Not applicable to threads - */ - isPublic?: boolean; - /** - * The ID of the user who archived this channel - */ - archivedBy?: string; - /** - * The ISO 8601 timestamp that the channel was archived at, if relevant - */ - archivedAt?: string; + /** + * The ID of the channel + */ + id: string; + /** + * The type of channel. This will determine what routes to use for creating content in a channel. For example, if this "chat", then one must use the routes for creating channel messages + */ + type: + | "announcements" + | "chat" + | "calendar" + | "forums" + | "media" + | "docs" + | "voice" + | "list" + | "scheduling" + | "stream"; + /** + * The name of the channel + */ + name: string; + /** + * The topic of the channel. Not applicable to threads + */ + topic?: string; + /** + * The ISO 8601 timestamp that the channel was created at + */ + createdAt: string; + /** + * The ID of the user who created this channel + */ + createdBy: string; + /** + * The ISO 8601 timestamp that the channel was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the server + */ + serverId: string; + /** + * ID of the **root** channel or thread in the channel hierarchy. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present + */ + rootId?: string; + /** + * ID of the **immediate** parent channel or thread in the channel hierarchy. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present + */ + parentId?: string; + /** + * The ID of the message that this channel was created off of. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present + */ + messageId?: string; + /** + * The category that the channel exists in. Only relevant for server channels + */ + categoryId?: number; + /** + * The ID of the group + */ + groupId: string; + /** + * What users can access the channel. Only applicable to server channels. If not present, this channel will respect normal permissions. `public` is accessible to everyone, even those who aren't of the server. `private` is only accessible to explicitly mentioned users. Currently, threads cannot be `public` and other channels cannot be `private`. Additionally, `private` threads can only exist with an associated `messageId` that is for a private message + */ + visibility?: + | "private" + | "public" + | null; + /** + * [DEPRECATED - use `visibility` instead] Whether the channel can be accessed from users who are not member of the server. Not applicable to threads + */ + isPublic?: boolean; + /** + * The ID of the user who archived this channel + */ + archivedBy?: string; + /** + * The ISO 8601 timestamp that the channel was archived at, if relevant + */ + archivedAt?: string; }; diff --git a/packages/api/lib/generated/router/models/ServerMember.ts b/packages/api/lib/generated/router/models/ServerMember.ts index a48655f4..a4d28c05 100644 --- a/packages/api/lib/generated/router/models/ServerMember.ts +++ b/packages/api/lib/generated/router/models/ServerMember.ts @@ -6,12 +6,12 @@ import type { User } from "./User"; export type ServerMember = { - user: User; - roleIds: Array; - nickname?: string; - /** - * The ISO 8601 timestamp that the member was created at - */ - joinedAt: string; - isOwner?: boolean; + user: User; + roleIds: Array; + nickname?: string; + /** + * The ISO 8601 timestamp that the member was created at + */ + joinedAt: string; + isOwner?: boolean; }; diff --git a/packages/api/lib/generated/router/models/ServerMemberBan.ts b/packages/api/lib/generated/router/models/ServerMemberBan.ts index d30d8972..38da162b 100644 --- a/packages/api/lib/generated/router/models/ServerMemberBan.ts +++ b/packages/api/lib/generated/router/models/ServerMemberBan.ts @@ -6,17 +6,17 @@ import type { UserSummary } from "./UserSummary"; export type ServerMemberBan = { - user: UserSummary; - /** - * The reason for the ban as submitted by the banner - */ - reason?: string; - /** - * The ID of the user who created this server member ban - */ - createdBy: string; - /** - * The ISO 8601 timestamp that the server member ban was created at - */ - createdAt: string; + user: UserSummary; + /** + * The reason for the ban as submitted by the banner + */ + reason?: string; + /** + * The ID of the user who created this server member ban + */ + createdBy: string; + /** + * The ISO 8601 timestamp that the server member ban was created at + */ + createdAt: string; }; diff --git a/packages/api/lib/generated/router/models/ServerMemberPermissions.ts b/packages/api/lib/generated/router/models/ServerMemberPermissions.ts index 8ad8072e..52be42fe 100644 --- a/packages/api/lib/generated/router/models/ServerMemberPermissions.ts +++ b/packages/api/lib/generated/router/models/ServerMemberPermissions.ts @@ -4,8 +4,8 @@ /* eslint-disable */ export type ServerMemberPermissions = { - /** - * Permissions must be a collection of valid permissions as defined in the [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) section - */ - permissions: Array; + /** + * Permissions must be a collection of valid permissions as defined in the [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) section + */ + permissions: Array; }; diff --git a/packages/api/lib/generated/router/models/ServerMemberSummary.ts b/packages/api/lib/generated/router/models/ServerMemberSummary.ts index 6aa086ce..b2ba99a7 100644 --- a/packages/api/lib/generated/router/models/ServerMemberSummary.ts +++ b/packages/api/lib/generated/router/models/ServerMemberSummary.ts @@ -6,6 +6,6 @@ import type { UserSummary } from "./UserSummary"; export type ServerMemberSummary = { - user: UserSummary; - roleIds: Array; + user: UserSummary; + roleIds: Array; }; diff --git a/packages/api/lib/generated/router/models/ServerSubscriptionTier.ts b/packages/api/lib/generated/router/models/ServerSubscriptionTier.ts index 39eb3293..5a8f73c5 100644 --- a/packages/api/lib/generated/router/models/ServerSubscriptionTier.ts +++ b/packages/api/lib/generated/router/models/ServerSubscriptionTier.ts @@ -4,28 +4,31 @@ /* eslint-disable */ export type ServerSubscriptionTier = { - /** - * The type of the server subscription tier. This field is case sensitive!! - */ - type: "Gold" | "Silver" | "Copper"; - /** - * The ID of the server - */ - serverId: string; - /** - * The description associated with the server subscription tier - */ - description?: string; - /** - * The ID of the role - */ - roleId?: number; - /** - * The cost of the tier in cents USD per month - */ - cost: number; - /** - * The ISO 8601 timestamp that the server subscription tier was created at - */ - createdAt: string; + /** + * The type of the server subscription tier. This field is case sensitive!! + */ + type: + | "Gold" + | "Silver" + | "Copper"; + /** + * The ID of the server + */ + serverId: string; + /** + * The description associated with the server subscription tier + */ + description?: string; + /** + * The ID of the role + */ + roleId?: number; + /** + * The cost of the tier in cents USD per month + */ + cost: number; + /** + * The ISO 8601 timestamp that the server subscription tier was created at + */ + createdAt: string; }; diff --git a/packages/api/lib/generated/router/models/SocialLink.ts b/packages/api/lib/generated/router/models/SocialLink.ts index 81dc4a1f..e0a5c0b3 100644 --- a/packages/api/lib/generated/router/models/SocialLink.ts +++ b/packages/api/lib/generated/router/models/SocialLink.ts @@ -4,24 +4,37 @@ /* eslint-disable */ export type SocialLink = { - /** - * The type of social link that Guilded supports. Depending on this value, `handle` or `serviceId` may or may not be present - */ - type: "twitch" | "bnet" | "psn" | "xbox" | "steam" | "origin" | "youtube" | "twitter" | "facebook" | "switch" | "patreon" | "roblox" | "epic"; - /** - * The ID of the user that the social link is associated with - */ - userId: string; - /** - * The handle of the user within the external service - */ - handle?: string; - /** - * The unique ID that represents this member's social link within the external service - */ - serviceId?: string; - /** - * The ISO 8601 timestamp that the social link was created at - */ - createdAt: string; + /** + * The type of social link that Guilded supports. Depending on this value, `handle` or `serviceId` may or may not be present + */ + type: + | "twitch" + | "bnet" + | "psn" + | "xbox" + | "steam" + | "origin" + | "youtube" + | "twitter" + | "facebook" + | "switch" + | "patreon" + | "roblox" + | "epic"; + /** + * The ID of the user that the social link is associated with + */ + userId: string; + /** + * The handle of the user within the external service + */ + handle?: string; + /** + * The unique ID that represents this member's social link within the external service + */ + serviceId?: string; + /** + * The ISO 8601 timestamp that the social link was created at + */ + createdAt: string; }; diff --git a/packages/api/lib/generated/router/models/User.ts b/packages/api/lib/generated/router/models/User.ts index da5e1b1a..602a0daa 100644 --- a/packages/api/lib/generated/router/models/User.ts +++ b/packages/api/lib/generated/router/models/User.ts @@ -6,29 +6,31 @@ import type { UserStatus } from "./UserStatus"; export type User = { - /** - * The ID of the user - */ - id: string; - /** - * The type of user. If this property is absent, it can assumed to be of type `user` - */ - type?: "bot" | "user"; - /** - * The user's name - */ - name: string; - /** - * The avatar image associated with the user - */ - avatar?: string; - /** - * The banner image associated with the user - */ - banner?: string; - /** - * The ISO 8601 timestamp that the user was created at - */ - createdAt: string; - status?: UserStatus; + /** + * The ID of the user + */ + id: string; + /** + * The type of user. If this property is absent, it can assumed to be of type `user` + */ + type?: + | "bot" + | "user"; + /** + * The user's name + */ + name: string; + /** + * The avatar image associated with the user + */ + avatar?: string; + /** + * The banner image associated with the user + */ + banner?: string; + /** + * The ISO 8601 timestamp that the user was created at + */ + createdAt: string; + status?: UserStatus; }; diff --git a/packages/api/lib/generated/router/models/UserStatus.ts b/packages/api/lib/generated/router/models/UserStatus.ts index 15a39f2c..262167bc 100644 --- a/packages/api/lib/generated/router/models/UserStatus.ts +++ b/packages/api/lib/generated/router/models/UserStatus.ts @@ -4,12 +4,12 @@ /* eslint-disable */ export type UserStatus = { - /** - * The content of the user status. The supported markdown for this content only includes reactions and plaintext for now - */ - content?: string; - /** - * Emote ID - */ - emoteId: number; + /** + * The content of the user status. The supported markdown for this content only includes reactions and plaintext for now + */ + content?: string; + /** + * Emote ID + */ + emoteId: number; }; diff --git a/packages/api/lib/generated/router/models/UserSummary.ts b/packages/api/lib/generated/router/models/UserSummary.ts index 064d927e..2bebb335 100644 --- a/packages/api/lib/generated/router/models/UserSummary.ts +++ b/packages/api/lib/generated/router/models/UserSummary.ts @@ -4,20 +4,22 @@ /* eslint-disable */ export type UserSummary = { - /** - * The ID of the user - */ - id: string; - /** - * The type of user. If this property is absent, it can assumed to be of type `user` - */ - type?: "bot" | "user"; - /** - * The user's name - */ - name: string; - /** - * The avatar image associated with the user - */ - avatar?: string; + /** + * The ID of the user + */ + id: string; + /** + * The type of user. If this property is absent, it can assumed to be of type `user` + */ + type?: + | "bot" + | "user"; + /** + * The user's name + */ + name: string; + /** + * The avatar image associated with the user + */ + avatar?: string; }; diff --git a/packages/api/lib/generated/router/models/Webhook.ts b/packages/api/lib/generated/router/models/Webhook.ts index 577c2bbc..0df1b144 100644 --- a/packages/api/lib/generated/router/models/Webhook.ts +++ b/packages/api/lib/generated/router/models/Webhook.ts @@ -4,40 +4,40 @@ /* eslint-disable */ export type Webhook = { - /** - * The ID of the webhook - */ - id: string; - /** - * The name of the webhook - */ - name: string; - /** - * The avatar image associated with the webhook - */ - avatar?: string; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the channel - */ - channelId: string; - /** - * The ISO 8601 timestamp that the webhook was created at - */ - createdAt: string; - /** - * The ID of the user who created this webhook - */ - createdBy: string; - /** - * The ISO 8601 timestamp that the webhook was deleted at - */ - deletedAt?: string; - /** - * The token of the webhook - */ - token?: string; + /** + * The ID of the webhook + */ + id: string; + /** + * The name of the webhook + */ + name: string; + /** + * The avatar image associated with the webhook + */ + avatar?: string; + /** + * The ID of the server + */ + serverId: string; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ISO 8601 timestamp that the webhook was created at + */ + createdAt: string; + /** + * The ID of the user who created this webhook + */ + createdBy: string; + /** + * The ISO 8601 timestamp that the webhook was deleted at + */ + deletedAt?: string; + /** + * The token of the webhook + */ + token?: string; }; diff --git a/packages/api/lib/generated/router/services/AnnouncementCommentsService.ts b/packages/api/lib/generated/router/services/AnnouncementCommentsService.ts index 5e557be4..5a421914 100644 --- a/packages/api/lib/generated/router/services/AnnouncementCommentsService.ts +++ b/packages/api/lib/generated/router/services/AnnouncementCommentsService.ts @@ -4,132 +4,166 @@ /* eslint-disable */ import type { AnnouncementComment } from "../models/AnnouncementComment"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class AnnouncementCommentsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a comment on an announcement - * @returns any Success - * @throws ApiError - */ - public announcementCommentCreate({ - channelId, - announcementId, - requestBody, - }: { - channelId: string; - announcementId: string; - requestBody: { - /** - * The content of the announcement comment - */ - content: string; - }; - }): CancelablePromise<{ - announcementComment: AnnouncementComment; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/announcements/{announcementId}/comments", - path: { - channelId: channelId, - announcementId: announcementId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a comment on an announcement + * @returns any Success + * @throws ApiError + */ + public announcementCommentCreate({ + channelId, + announcementId, + requestBody, + }: { + channelId: string; + announcementId: string; + requestBody: { + /** + * The content of the announcement comment + */ + content: string; + }; + }): CancelablePromise<{ + announcementComment: AnnouncementComment; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/announcements/{announcementId}/comments", + path: { + channelId: channelId, + announcementId: announcementId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get an announcement's comments - * @returns any Success - * @throws ApiError - */ - public announcementCommentReadMany({ channelId, announcementId }: { channelId: string; announcementId: string }): CancelablePromise<{ - announcementComments: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/announcements/{announcementId}/comments", - path: { - channelId: channelId, - announcementId: announcementId, - }, - }); - } + /** + * Get an announcement's comments + * @returns any Success + * @throws ApiError + */ + public announcementCommentReadMany({ + channelId, + announcementId, + }: { + channelId: string; + announcementId: string; + }): CancelablePromise<{ + announcementComments: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/announcements/{announcementId}/comments", + path: { + channelId: channelId, + announcementId: announcementId, + }, + }, + ); + } - /** - * Get a comment on the announcement - * @returns any Success - * @throws ApiError - */ - public announcementCommentRead({ channelId, announcementId, announcementCommentId }: { channelId: string; announcementId: string; announcementCommentId: number }): CancelablePromise<{ - announcementComment: AnnouncementComment; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/announcements/{announcementId}/comments/{announcementCommentId}", - path: { - channelId: channelId, - announcementId: announcementId, - announcementCommentId: announcementCommentId, - }, - }); - } + /** + * Get a comment on the announcement + * @returns any Success + * @throws ApiError + */ + public announcementCommentRead({ + channelId, + announcementId, + announcementCommentId, + }: { + channelId: string; + announcementId: string; + announcementCommentId: number; + }): CancelablePromise<{ + announcementComment: AnnouncementComment; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/announcements/{announcementId}/comments/{announcementCommentId}", + path: { + channelId: channelId, + announcementId: announcementId, + announcementCommentId: announcementCommentId, + }, + }, + ); + } - /** - * Update an announcement comment - * @returns any Success - * @throws ApiError - */ - public announcementCommentUpdate({ - channelId, - announcementId, - announcementCommentId, - requestBody, - }: { - channelId: string; - announcementId: string; - announcementCommentId: number; - requestBody: { - /** - * The content of the announcement comment - */ - content: string; - }; - }): CancelablePromise<{ - announcementComment: AnnouncementComment; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/channels/{channelId}/announcements/{announcementId}/comments/{announcementCommentId}", - path: { - channelId: channelId, - announcementId: announcementId, - announcementCommentId: announcementCommentId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update an announcement comment + * @returns any Success + * @throws ApiError + */ + public announcementCommentUpdate({ + channelId, + announcementId, + announcementCommentId, + requestBody, + }: { + channelId: string; + announcementId: string; + announcementCommentId: number; + requestBody: { + /** + * The content of the announcement comment + */ + content: string; + }; + }): CancelablePromise<{ + announcementComment: AnnouncementComment; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/channels/{channelId}/announcements/{announcementId}/comments/{announcementCommentId}", + path: { + channelId: channelId, + announcementId: announcementId, + announcementCommentId: announcementCommentId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete an announcement comment - * @returns void - * @throws ApiError - */ - public announcementCommentDelete({ channelId, announcementId, announcementCommentId }: { channelId: string; announcementId: string; announcementCommentId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/announcements/{announcementId}/comments/{announcementCommentId}", - path: { - channelId: channelId, - announcementId: announcementId, - announcementCommentId: announcementCommentId, - }, - }); - } + /** + * Delete an announcement comment + * @returns void + * @throws ApiError + */ + public announcementCommentDelete({ + channelId, + announcementId, + announcementCommentId, + }: { + channelId: string; + announcementId: string; + announcementCommentId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/announcements/{announcementId}/comments/{announcementCommentId}", + path: { + channelId: channelId, + announcementId: announcementId, + announcementCommentId: announcementCommentId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/AnnouncementsService.ts b/packages/api/lib/generated/router/services/AnnouncementsService.ts index faf3c9b1..714b0ba1 100644 --- a/packages/api/lib/generated/router/services/AnnouncementsService.ts +++ b/packages/api/lib/generated/router/services/AnnouncementsService.ts @@ -4,136 +4,178 @@ /* eslint-disable */ import type { Announcement } from "../models/Announcement"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class AnnouncementsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create an announcement - * @returns any Success - * @throws ApiError - */ - public announcementCreate({ - channelId, - requestBody, - }: { - channelId: string; - requestBody: { - /** - * The title of the announcement - */ - title: string; - /** - * The content of the announcement - */ - content: Record | string; - }; - }): CancelablePromise<{ - announcement: Announcement; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/announcements", - path: { - channelId: channelId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create an announcement + * @returns any Success + * @throws ApiError + */ + public announcementCreate({ + channelId, + requestBody, + }: { + channelId: string; + requestBody: { + /** + * The title of the announcement + */ + title: string; + /** + * The content of the announcement + */ + content: + | Record< + string, + any + > + | string; + }; + }): CancelablePromise<{ + announcement: Announcement; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/announcements", + path: { + channelId: channelId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get announcements - * Results returned will be ordered ascending by the announcement's `createdAt`. `before` will filter based on the announcement's `createdAt` - * @returns any Success - * @throws ApiError - */ - public announcementReadMany({ channelId, before, limit = 25 }: { channelId: string; before?: string; limit?: number }): CancelablePromise<{ - announcements: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/announcements", - path: { - channelId: channelId, - }, - query: { - before: before, - limit: limit, - }, - }); - } + /** + * Get announcements + * Results returned will be ordered ascending by the announcement's `createdAt`. `before` will filter based on the announcement's `createdAt` + * @returns any Success + * @throws ApiError + */ + public announcementReadMany({ + channelId, + before, + limit = 25, + }: { + channelId: string; + before?: string; + limit?: number; + }): CancelablePromise<{ + announcements: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/announcements", + path: { + channelId: channelId, + }, + query: { + before: before, + limit: limit, + }, + }, + ); + } - /** - * Read an announcement - * @returns any Success - * @throws ApiError - */ - public announcementRead({ channelId, announcementId }: { channelId: string; announcementId: string }): CancelablePromise<{ - announcement: Announcement; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/announcements/{announcementId}", - path: { - channelId: channelId, - announcementId: announcementId, - }, - }); - } + /** + * Read an announcement + * @returns any Success + * @throws ApiError + */ + public announcementRead({ + channelId, + announcementId, + }: { + channelId: string; + announcementId: string; + }): CancelablePromise<{ + announcement: Announcement; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/announcements/{announcementId}", + path: { + channelId: channelId, + announcementId: announcementId, + }, + }, + ); + } - /** - * Update an announcement - * @returns any Success - * @throws ApiError - */ - public announcementUpdate({ - channelId, - announcementId, - requestBody, - }: { - channelId: string; - announcementId: string; - requestBody: { - /** - * The title of the announcement - */ - title?: string; - /** - * The content of the announcement - */ - content?: Record | string; - }; - }): CancelablePromise<{ - announcement: Announcement; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/channels/{channelId}/announcements/{announcementId}", - path: { - channelId: channelId, - announcementId: announcementId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update an announcement + * @returns any Success + * @throws ApiError + */ + public announcementUpdate({ + channelId, + announcementId, + requestBody, + }: { + channelId: string; + announcementId: string; + requestBody: { + /** + * The title of the announcement + */ + title?: string; + /** + * The content of the announcement + */ + content?: + | Record< + string, + any + > + | string; + }; + }): CancelablePromise<{ + announcement: Announcement; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/channels/{channelId}/announcements/{announcementId}", + path: { + channelId: channelId, + announcementId: announcementId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete an announcement - * @returns void - * @throws ApiError - */ - public announcementDelete({ channelId, announcementId }: { channelId: string; announcementId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/announcements/{announcementId}", - path: { - channelId: channelId, - announcementId: announcementId, - }, - }); - } + /** + * Delete an announcement + * @returns void + * @throws ApiError + */ + public announcementDelete({ + channelId, + announcementId, + }: { + channelId: string; + announcementId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/announcements/{announcementId}", + path: { + channelId: channelId, + announcementId: announcementId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/CalendarEventCommentsService.ts b/packages/api/lib/generated/router/services/CalendarEventCommentsService.ts index 1476dbe9..19a39861 100644 --- a/packages/api/lib/generated/router/services/CalendarEventCommentsService.ts +++ b/packages/api/lib/generated/router/services/CalendarEventCommentsService.ts @@ -4,132 +4,166 @@ /* eslint-disable */ import type { CalendarEventComment } from "../models/CalendarEventComment"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class CalendarEventCommentsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a comment on an event - * @returns any Success - * @throws ApiError - */ - public calendarEventCommentCreate({ - channelId, - calendarEventId, - requestBody, - }: { - channelId: string; - calendarEventId: number; - requestBody: { - /** - * The content of the calendar event comment - */ - content: string; - }; - }): CancelablePromise<{ - calendarEventComment: CalendarEventComment; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/events/{calendarEventId}/comments", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a comment on an event + * @returns any Success + * @throws ApiError + */ + public calendarEventCommentCreate({ + channelId, + calendarEventId, + requestBody, + }: { + channelId: string; + calendarEventId: number; + requestBody: { + /** + * The content of the calendar event comment + */ + content: string; + }; + }): CancelablePromise<{ + calendarEventComment: CalendarEventComment; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/events/{calendarEventId}/comments", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get a calendar event's comments - * @returns any Success - * @throws ApiError - */ - public calendarEventCommentReadMany({ channelId, calendarEventId }: { channelId: string; calendarEventId: number }): CancelablePromise<{ - calendarEventComments: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/events/{calendarEventId}/comments", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - }, - }); - } + /** + * Get a calendar event's comments + * @returns any Success + * @throws ApiError + */ + public calendarEventCommentReadMany({ + channelId, + calendarEventId, + }: { + channelId: string; + calendarEventId: number; + }): CancelablePromise<{ + calendarEventComments: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/events/{calendarEventId}/comments", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + }, + }, + ); + } - /** - * Get a comment on the calendar event - * @returns any Success - * @throws ApiError - */ - public calendarEventCommentRead({ channelId, calendarEventId, calendarEventCommentId }: { channelId: string; calendarEventId: number; calendarEventCommentId: number }): CancelablePromise<{ - calendarEventComment: CalendarEventComment; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/events/{calendarEventId}/comments/{calendarEventCommentId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - calendarEventCommentId: calendarEventCommentId, - }, - }); - } + /** + * Get a comment on the calendar event + * @returns any Success + * @throws ApiError + */ + public calendarEventCommentRead({ + channelId, + calendarEventId, + calendarEventCommentId, + }: { + channelId: string; + calendarEventId: number; + calendarEventCommentId: number; + }): CancelablePromise<{ + calendarEventComment: CalendarEventComment; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/events/{calendarEventId}/comments/{calendarEventCommentId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + calendarEventCommentId: calendarEventCommentId, + }, + }, + ); + } - /** - * Update a calendar event comment - * @returns any Success - * @throws ApiError - */ - public calendarEventCommentUpdate({ - channelId, - calendarEventId, - calendarEventCommentId, - requestBody, - }: { - channelId: string; - calendarEventId: number; - calendarEventCommentId: number; - requestBody: { - /** - * The content of the calendar event comment - */ - content: string; - }; - }): CancelablePromise<{ - calendarEventComment: CalendarEventComment; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/channels/{channelId}/events/{calendarEventId}/comments/{calendarEventCommentId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - calendarEventCommentId: calendarEventCommentId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a calendar event comment + * @returns any Success + * @throws ApiError + */ + public calendarEventCommentUpdate({ + channelId, + calendarEventId, + calendarEventCommentId, + requestBody, + }: { + channelId: string; + calendarEventId: number; + calendarEventCommentId: number; + requestBody: { + /** + * The content of the calendar event comment + */ + content: string; + }; + }): CancelablePromise<{ + calendarEventComment: CalendarEventComment; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/channels/{channelId}/events/{calendarEventId}/comments/{calendarEventCommentId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + calendarEventCommentId: calendarEventCommentId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a calendar event comment - * @returns void - * @throws ApiError - */ - public calendarEventCommentDelete({ channelId, calendarEventId, calendarEventCommentId }: { channelId: string; calendarEventId: number; calendarEventCommentId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/events/{calendarEventId}/comments/{calendarEventCommentId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - calendarEventCommentId: calendarEventCommentId, - }, - }); - } + /** + * Delete a calendar event comment + * @returns void + * @throws ApiError + */ + public calendarEventCommentDelete({ + channelId, + calendarEventId, + calendarEventCommentId, + }: { + channelId: string; + calendarEventId: number; + calendarEventCommentId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/events/{calendarEventId}/comments/{calendarEventCommentId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + calendarEventCommentId: calendarEventCommentId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/CalendarEventSeriesService.ts b/packages/api/lib/generated/router/services/CalendarEventSeriesService.ts index ceb46165..43e7c0a9 100644 --- a/packages/api/lib/generated/router/services/CalendarEventSeriesService.ts +++ b/packages/api/lib/generated/router/services/CalendarEventSeriesService.ts @@ -1,152 +1,175 @@ +import type { BaseHttpRequest } from "../core/BaseHttpRequest"; /* generated using openapi-typescript-codegen -- do no edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { CancelablePromise } from "../core/CancelablePromise"; -import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export class CalendarEventSeriesService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Update a calendar event series - * @returns void - * @throws ApiError - */ - public calendarEventSeriesUpdate({ - channelId, - calendarEventSeriesId, - requestBody, - }: { - channelId: string; - calendarEventSeriesId: string; - requestBody: { - /** - * The name of the event - */ - name?: string; - /** - * The description of the event - */ - description?: string; - /** - * The location of the event - */ - location?: string; - /** - * The ISO 8601 timestamp that the event starts at - */ - startsAt?: string; - /** - * A URL to associate with the event - */ - url?: string; - /** - * The integer value corresponds to the decimal RGB representation for the color. The color of the event when viewing in the calendar - */ - color?: number; - /** - * Does the event last all day? If passed with `duration`, `duration` will only be applied if it is an interval of minutes represented in days (e.g., `duration: 2880`) - */ - isAllDay?: boolean; - /** - * When disabled, users will not be able to RSVP to the event - */ - rsvpDisabled?: boolean; - /** - * The number of RSVPs to allow before waitlisting RSVPs - */ - rsvpLimit?: number; - /** - * When `rsvpLimit` is set, users from the waitlist will be added as space becomes available in the event - */ - autofillWaitlist?: boolean; - /** - * The duration of the event _**in minutes**_ - */ - duration?: number; - isPrivate?: boolean; - /** - * The role IDs to restrict the event to. Passing an empty array will clear the role IDs on the event - */ - roleIds?: Array; - repeatInfo?: { - /** - * How often you want your event to repeat (important note: this will repeat for the next 180 days unless custom is defined) - */ - type: "once" | "everyDay" | "everyWeek" | "everyMonth" | "custom"; - /** - * Apply further clarification to your events. This **must** have `type` set to `custom` - */ - every?: { - /** - * How often between your interval the event should repeat. For example, 1 would be every interval, 2 would be every second occurrence of the interval - */ - count: number; - /** - * Coupled with `count`, this indicates the time range you are repeating your event over - */ - interval: "day" | "month" | "year" | "week"; - }; - /** - * Used to control the end date of the event repeat (only used when `type` is `custom`; if used with `endDate`, the earliest resultant date of the two will be used) - */ - endsAfterOccurrences?: number; - /** - * The ISO 8601 timestamp that the event ends at. Used to control the end date of the event repeat (only used when `type` is `custom`; if used with `endsAfterOccurrences`, the earliest resultant date of the two will be used) - */ - endDate?: string; - /** - * Used to control the day of the week that the event should repeat on (only used when `type` is `custom` and when `every.interval` is `week`) - */ - on?: Array<"sunday" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday">; - }; - /** - * Control the updating of the series from the `calendarEventId` forward. If not defined, it will edit all events - */ - calendarEventId?: number; - }; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PATCH", - url: "/channels/{channelId}/event_series/{calendarEventSeriesId}", - path: { - channelId: channelId, - calendarEventSeriesId: calendarEventSeriesId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a calendar event series + * @returns void + * @throws ApiError + */ + public calendarEventSeriesUpdate({ + channelId, + calendarEventSeriesId, + requestBody, + }: { + channelId: string; + calendarEventSeriesId: string; + requestBody: { + /** + * The name of the event + */ + name?: string; + /** + * The description of the event + */ + description?: string; + /** + * The location of the event + */ + location?: string; + /** + * The ISO 8601 timestamp that the event starts at + */ + startsAt?: string; + /** + * A URL to associate with the event + */ + url?: string; + /** + * The integer value corresponds to the decimal RGB representation for the color. The color of the event when viewing in the calendar + */ + color?: number; + /** + * Does the event last all day? If passed with `duration`, `duration` will only be applied if it is an interval of minutes represented in days (e.g., `duration: 2880`) + */ + isAllDay?: boolean; + /** + * When disabled, users will not be able to RSVP to the event + */ + rsvpDisabled?: boolean; + /** + * The number of RSVPs to allow before waitlisting RSVPs + */ + rsvpLimit?: number; + /** + * When `rsvpLimit` is set, users from the waitlist will be added as space becomes available in the event + */ + autofillWaitlist?: boolean; + /** + * The duration of the event _**in minutes**_ + */ + duration?: number; + isPrivate?: boolean; + /** + * The role IDs to restrict the event to. Passing an empty array will clear the role IDs on the event + */ + roleIds?: Array; + repeatInfo?: { + /** + * How often you want your event to repeat (important note: this will repeat for the next 180 days unless custom is defined) + */ + type: + | "once" + | "everyDay" + | "everyWeek" + | "everyMonth" + | "custom"; + /** + * Apply further clarification to your events. This **must** have `type` set to `custom` + */ + every?: { + /** + * How often between your interval the event should repeat. For example, 1 would be every interval, 2 would be every second occurrence of the interval + */ + count: number; + /** + * Coupled with `count`, this indicates the time range you are repeating your event over + */ + interval: + | "day" + | "month" + | "year" + | "week"; + }; + /** + * Used to control the end date of the event repeat (only used when `type` is `custom`; if used with `endDate`, the earliest resultant date of the two will be used) + */ + endsAfterOccurrences?: number; + /** + * The ISO 8601 timestamp that the event ends at. Used to control the end date of the event repeat (only used when `type` is `custom`; if used with `endsAfterOccurrences`, the earliest resultant date of the two will be used) + */ + endDate?: string; + /** + * Used to control the day of the week that the event should repeat on (only used when `type` is `custom` and when `every.interval` is `week`) + */ + on?: Array< + | "sunday" + | "monday" + | "tuesday" + | "wednesday" + | "thursday" + | "friday" + | "saturday" + >; + }; + /** + * Control the updating of the series from the `calendarEventId` forward. If not defined, it will edit all events + */ + calendarEventId?: number; + }; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PATCH", + url: "/channels/{channelId}/event_series/{calendarEventSeriesId}", + path: { + channelId: channelId, + calendarEventSeriesId: calendarEventSeriesId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a calendar event series - * @returns void - * @throws ApiError - */ - public calendarEventSeriesDelete({ - channelId, - calendarEventSeriesId, - requestBody, - }: { - channelId: string; - calendarEventSeriesId: string; - requestBody?: { - /** - * Control the deletion of the series from the `calendarEventId` forward. If not defined, it will delete all events - */ - calendarEventId?: number; - }; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/event_series/{calendarEventSeriesId}", - path: { - channelId: channelId, - calendarEventSeriesId: calendarEventSeriesId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Delete a calendar event series + * @returns void + * @throws ApiError + */ + public calendarEventSeriesDelete({ + channelId, + calendarEventSeriesId, + requestBody, + }: { + channelId: string; + calendarEventSeriesId: string; + requestBody?: { + /** + * Control the deletion of the series from the `calendarEventId` forward. If not defined, it will delete all events + */ + calendarEventId?: number; + }; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/event_series/{calendarEventSeriesId}", + path: { + channelId: channelId, + calendarEventSeriesId: calendarEventSeriesId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/CalendarEventsService.ts b/packages/api/lib/generated/router/services/CalendarEventsService.ts index f6827431..1fb8233d 100644 --- a/packages/api/lib/generated/router/services/CalendarEventsService.ts +++ b/packages/api/lib/generated/router/services/CalendarEventsService.ts @@ -5,383 +5,483 @@ import type { CalendarEvent } from "../models/CalendarEvent"; import type { CalendarEventRsvp } from "../models/CalendarEventRsvp"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class CalendarEventsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a calendar event - * We currently do not have a way to surface the `repeatInfo` after event series are updated. Stay tuned! - * @returns any Success - * @throws ApiError - */ - public calendarEventCreate({ - channelId, - requestBody, - }: { - /** - * The calendar to create the event in - */ - channelId: string; - requestBody: { - /** - * The name of the event - */ - name: string; - /** - * The description of the event - */ - description?: string; - /** - * The location of the event - */ - location?: string; - /** - * The ISO 8601 timestamp that the event starts at - */ - startsAt?: string; - /** - * A URL to associate with the event - */ - url?: string; - /** - * The integer value corresponds to the decimal RGB representation for the color. The color of the event when viewing in the calendar - */ - color?: number; - /** - * Does the event last all day? If passed with `duration`, `duration` will only be applied if it is an interval of minutes represented in days (e.g., `duration: 2880`) - */ - isAllDay?: boolean; - /** - * When disabled, users will not be able to RSVP to the event - */ - rsvpDisabled?: boolean; - /** - * The number of RSVPs to allow before waitlisting RSVPs - */ - rsvpLimit?: number; - /** - * When `rsvpLimit` is set, users from the waitlist will be added as space becomes available in the event - */ - autofillWaitlist?: boolean; - /** - * The duration of the event _**in minutes**_ - */ - duration?: number; - isPrivate?: boolean; - /** - * The role IDs to restrict the event to - */ - roleIds?: Array; - repeatInfo?: { - /** - * How often you want your event to repeat (important note: this will repeat for the next 180 days unless custom is defined) - */ - type: "once" | "everyDay" | "everyWeek" | "everyMonth" | "custom"; - /** - * Apply further clarification to your events. This **must** have `type` set to `custom` - */ - every?: { - /** - * How often between your interval the event should repeat. For example, 1 would be every interval, 2 would be every second occurrence of the interval - */ - count: number; - /** - * Coupled with `count`, this indicates the time range you are repeating your event over - */ - interval: "day" | "month" | "year" | "week"; - }; - /** - * Used to control the end date of the event repeat (only used when `type` is `custom`; if used with `endDate`, the earliest resultant date of the two will be used) - */ - endsAfterOccurrences?: number; - /** - * The ISO 8601 timestamp that the event ends at. Used to control the end date of the event repeat (only used when `type` is `custom`; if used with `endsAfterOccurrences`, the earliest resultant date of the two will be used) - */ - endDate?: string; - /** - * Used to control the day of the week that the event should repeat on (only used when `type` is `custom` and when `every.interval` is `week`) - */ - on?: Array<"sunday" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday">; - }; - }; - }): CancelablePromise<{ - calendarEvent: CalendarEvent; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/events", - path: { - channelId: channelId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a calendar event + * We currently do not have a way to surface the `repeatInfo` after event series are updated. Stay tuned! + * @returns any Success + * @throws ApiError + */ + public calendarEventCreate({ + channelId, + requestBody, + }: { + /** + * The calendar to create the event in + */ + channelId: string; + requestBody: { + /** + * The name of the event + */ + name: string; + /** + * The description of the event + */ + description?: string; + /** + * The location of the event + */ + location?: string; + /** + * The ISO 8601 timestamp that the event starts at + */ + startsAt?: string; + /** + * A URL to associate with the event + */ + url?: string; + /** + * The integer value corresponds to the decimal RGB representation for the color. The color of the event when viewing in the calendar + */ + color?: number; + /** + * Does the event last all day? If passed with `duration`, `duration` will only be applied if it is an interval of minutes represented in days (e.g., `duration: 2880`) + */ + isAllDay?: boolean; + /** + * When disabled, users will not be able to RSVP to the event + */ + rsvpDisabled?: boolean; + /** + * The number of RSVPs to allow before waitlisting RSVPs + */ + rsvpLimit?: number; + /** + * When `rsvpLimit` is set, users from the waitlist will be added as space becomes available in the event + */ + autofillWaitlist?: boolean; + /** + * The duration of the event _**in minutes**_ + */ + duration?: number; + isPrivate?: boolean; + /** + * The role IDs to restrict the event to + */ + roleIds?: Array; + repeatInfo?: { + /** + * How often you want your event to repeat (important note: this will repeat for the next 180 days unless custom is defined) + */ + type: + | "once" + | "everyDay" + | "everyWeek" + | "everyMonth" + | "custom"; + /** + * Apply further clarification to your events. This **must** have `type` set to `custom` + */ + every?: { + /** + * How often between your interval the event should repeat. For example, 1 would be every interval, 2 would be every second occurrence of the interval + */ + count: number; + /** + * Coupled with `count`, this indicates the time range you are repeating your event over + */ + interval: + | "day" + | "month" + | "year" + | "week"; + }; + /** + * Used to control the end date of the event repeat (only used when `type` is `custom`; if used with `endDate`, the earliest resultant date of the two will be used) + */ + endsAfterOccurrences?: number; + /** + * The ISO 8601 timestamp that the event ends at. Used to control the end date of the event repeat (only used when `type` is `custom`; if used with `endsAfterOccurrences`, the earliest resultant date of the two will be used) + */ + endDate?: string; + /** + * Used to control the day of the week that the event should repeat on (only used when `type` is `custom` and when `every.interval` is `week`) + */ + on?: Array< + | "sunday" + | "monday" + | "tuesday" + | "wednesday" + | "thursday" + | "friday" + | "saturday" + >; + }; + }; + }): CancelablePromise<{ + calendarEvent: CalendarEvent; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/events", + path: { + channelId: channelId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get calendar events - * Results returned will be ordered ascending by the event's `startsAt`. `before` and `after` will filter based on the event's `startsAt` - * @returns any Success - * @throws ApiError - */ - public calendarEventReadMany({ channelId, before, after, limit = 25 }: { channelId: string; before?: string; after?: string; limit?: number }): CancelablePromise<{ - calendarEvents: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/events", - path: { - channelId: channelId, - }, - query: { - before: before, - after: after, - limit: limit, - }, - }); - } + /** + * Get calendar events + * Results returned will be ordered ascending by the event's `startsAt`. `before` and `after` will filter based on the event's `startsAt` + * @returns any Success + * @throws ApiError + */ + public calendarEventReadMany({ + channelId, + before, + after, + limit = 25, + }: { + channelId: string; + before?: string; + after?: string; + limit?: number; + }): CancelablePromise<{ + calendarEvents: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/events", + path: { + channelId: channelId, + }, + query: { + before: before, + after: after, + limit: limit, + }, + }, + ); + } - /** - * Get a calendar event - * @returns any Success - * @throws ApiError - */ - public calendarEventRead({ channelId, calendarEventId }: { channelId: string; calendarEventId: number }): CancelablePromise<{ - calendarEvent: CalendarEvent; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/events/{calendarEventId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - }, - }); - } + /** + * Get a calendar event + * @returns any Success + * @throws ApiError + */ + public calendarEventRead({ + channelId, + calendarEventId, + }: { + channelId: string; + calendarEventId: number; + }): CancelablePromise<{ + calendarEvent: CalendarEvent; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/events/{calendarEventId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + }, + }, + ); + } - /** - * Update a calendar event - * We currently do not have a way to surface the `repeatInfo` after event series are updated. Stay tuned! - * @returns any Success - * @throws ApiError - */ - public calendarEventUpdate({ - channelId, - calendarEventId, - requestBody, - }: { - channelId: string; - calendarEventId: number; - requestBody: { - /** - * The name of the event - */ - name?: string; - /** - * The description of the event - */ - description?: string; - /** - * The location of the event - */ - location?: string; - /** - * The ISO 8601 timestamp that the event starts at - */ - startsAt?: string; - /** - * A URL to associate with the event - */ - url?: string; - /** - * The integer value corresponds to the decimal RGB representation for the color. The color of the event when viewing in the calendar - */ - color?: number; - /** - * Does the event last all day? If passed with `duration`, `duration` will only be applied if it is an interval of minutes represented in days (e.g., `duration: 2880`) - */ - isAllDay?: boolean; - /** - * When disabled, users will not be able to RSVP to the event - */ - rsvpDisabled?: boolean; - /** - * The number of RSVPs to allow before waitlisting RSVPs - */ - rsvpLimit?: number; - /** - * When `rsvpLimit` is set, users from the waitlist will be added as space becomes available in the event - */ - autofillWaitlist?: boolean; - /** - * The duration of the event _**in minutes**_ - */ - duration?: number; - isPrivate?: boolean; - /** - * The role IDs to restrict the event to. Passing an empty array will clear the role IDs on the event - */ - roleIds?: Array; - cancellation?: { - /** - * The description of event cancellation - */ - description?: string; - }; - }; - }): CancelablePromise<{ - calendarEvent: CalendarEvent; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/channels/{channelId}/events/{calendarEventId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a calendar event + * We currently do not have a way to surface the `repeatInfo` after event series are updated. Stay tuned! + * @returns any Success + * @throws ApiError + */ + public calendarEventUpdate({ + channelId, + calendarEventId, + requestBody, + }: { + channelId: string; + calendarEventId: number; + requestBody: { + /** + * The name of the event + */ + name?: string; + /** + * The description of the event + */ + description?: string; + /** + * The location of the event + */ + location?: string; + /** + * The ISO 8601 timestamp that the event starts at + */ + startsAt?: string; + /** + * A URL to associate with the event + */ + url?: string; + /** + * The integer value corresponds to the decimal RGB representation for the color. The color of the event when viewing in the calendar + */ + color?: number; + /** + * Does the event last all day? If passed with `duration`, `duration` will only be applied if it is an interval of minutes represented in days (e.g., `duration: 2880`) + */ + isAllDay?: boolean; + /** + * When disabled, users will not be able to RSVP to the event + */ + rsvpDisabled?: boolean; + /** + * The number of RSVPs to allow before waitlisting RSVPs + */ + rsvpLimit?: number; + /** + * When `rsvpLimit` is set, users from the waitlist will be added as space becomes available in the event + */ + autofillWaitlist?: boolean; + /** + * The duration of the event _**in minutes**_ + */ + duration?: number; + isPrivate?: boolean; + /** + * The role IDs to restrict the event to. Passing an empty array will clear the role IDs on the event + */ + roleIds?: Array; + cancellation?: { + /** + * The description of event cancellation + */ + description?: string; + }; + }; + }): CancelablePromise<{ + calendarEvent: CalendarEvent; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/channels/{channelId}/events/{calendarEventId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a calendar event - * @returns void - * @throws ApiError - */ - public calendarEventDelete({ channelId, calendarEventId }: { channelId: string; calendarEventId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/events/{calendarEventId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - }, - }); - } + /** + * Delete a calendar event + * @returns void + * @throws ApiError + */ + public calendarEventDelete({ + channelId, + calendarEventId, + }: { + channelId: string; + calendarEventId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/events/{calendarEventId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + }, + }, + ); + } - /** - * Get a calendar event RSVP - * @returns any Success - * @throws ApiError - */ - public calendarEventRsvpRead({ channelId, calendarEventId, userId }: { channelId: string; calendarEventId: number; userId: string | "@me" }): CancelablePromise<{ - calendarEventRsvp: CalendarEventRsvp; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/events/{calendarEventId}/rsvps/{userId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - userId: userId, - }, - }); - } + /** + * Get a calendar event RSVP + * @returns any Success + * @throws ApiError + */ + public calendarEventRsvpRead({ + channelId, + calendarEventId, + userId, + }: { + channelId: string; + calendarEventId: number; + userId: + | string + | "@me"; + }): CancelablePromise<{ + calendarEventRsvp: CalendarEventRsvp; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/events/{calendarEventId}/rsvps/{userId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + userId: userId, + }, + }, + ); + } - /** - * Create or update a calendar event RSVP - * @returns any Success - * @throws ApiError - */ - public calendarEventRsvpUpdate({ - channelId, - calendarEventId, - userId, - requestBody, - }: { - channelId: string; - calendarEventId: number; - userId: string | "@me"; - requestBody: { - /** - * The status of the RSVP - */ - status: "going" | "maybe" | "declined" | "invited"; - }; - }): CancelablePromise<{ - calendarEventRsvp: CalendarEventRsvp; - }> { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/events/{calendarEventId}/rsvps/{userId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - userId: userId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create or update a calendar event RSVP + * @returns any Success + * @throws ApiError + */ + public calendarEventRsvpUpdate({ + channelId, + calendarEventId, + userId, + requestBody, + }: { + channelId: string; + calendarEventId: number; + userId: + | string + | "@me"; + requestBody: { + /** + * The status of the RSVP + */ + status: + | "going" + | "maybe" + | "declined" + | "invited"; + }; + }): CancelablePromise<{ + calendarEventRsvp: CalendarEventRsvp; + }> { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/events/{calendarEventId}/rsvps/{userId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + userId: userId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a calendar event RSVP - * @returns void - * @throws ApiError - */ - public calendarEventRsvpDelete({ channelId, calendarEventId, userId }: { channelId: string; calendarEventId: number; userId: string | "@me" }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/events/{calendarEventId}/rsvps/{userId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - userId: userId, - }, - }); - } + /** + * Delete a calendar event RSVP + * @returns void + * @throws ApiError + */ + public calendarEventRsvpDelete({ + channelId, + calendarEventId, + userId, + }: { + channelId: string; + calendarEventId: number; + userId: + | string + | "@me"; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/events/{calendarEventId}/rsvps/{userId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + userId: userId, + }, + }, + ); + } - /** - * Get calendar event RSVPs - * @returns any Success - * @throws ApiError - */ - public calendarEventRsvpReadMany({ channelId, calendarEventId }: { channelId: string; calendarEventId: number }): CancelablePromise<{ - calendarEventRsvps: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/events/{calendarEventId}/rsvps", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - }, - }); - } + /** + * Get calendar event RSVPs + * @returns any Success + * @throws ApiError + */ + public calendarEventRsvpReadMany({ + channelId, + calendarEventId, + }: { + channelId: string; + calendarEventId: number; + }): CancelablePromise<{ + calendarEventRsvps: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/events/{calendarEventId}/rsvps", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + }, + }, + ); + } - /** - * Create or update a calendar event RSVP for multiple users - * @returns void - * @throws ApiError - */ - public calendarEventRsvpUpdateMany({ - channelId, - calendarEventId, - requestBody, - }: { - channelId: string; - calendarEventId: number; - requestBody: { - userIds: Array; - /** - * The status of the RSVP - */ - status: "going" | "maybe" | "declined" | "invited"; - }; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/events/{calendarEventId}/rsvps", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create or update a calendar event RSVP for multiple users + * @returns void + * @throws ApiError + */ + public calendarEventRsvpUpdateMany({ + channelId, + calendarEventId, + requestBody, + }: { + channelId: string; + calendarEventId: number; + requestBody: { + userIds: Array< + | string + | "@me" + >; + /** + * The status of the RSVP + */ + status: + | "going" + | "maybe" + | "declined" + | "invited"; + }; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/events/{calendarEventId}/rsvps", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/CategoriesService.ts b/packages/api/lib/generated/router/services/CategoriesService.ts index 8ded0c59..ff43283a 100644 --- a/packages/api/lib/generated/router/services/CategoriesService.ts +++ b/packages/api/lib/generated/router/services/CategoriesService.ts @@ -4,112 +4,134 @@ /* eslint-disable */ import type { Category } from "../models/Category"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class CategoriesService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a category - * @returns any Success - * @throws ApiError - */ - public categoryCreate({ - serverId, - requestBody, - }: { - serverId: string; - requestBody: { - /** - * Name of the category - */ - name: string; - /** - * The ID of the group. If not provided, the category will be created in the "Server home" group from `serverId`. - */ - groupId?: string; - }; - }): CancelablePromise<{ - category: Category; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/servers/{serverId}/categories", - path: { - serverId: serverId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a category + * @returns any Success + * @throws ApiError + */ + public categoryCreate({ + serverId, + requestBody, + }: { + serverId: string; + requestBody: { + /** + * Name of the category + */ + name: string; + /** + * The ID of the group. If not provided, the category will be created in the "Server home" group from `serverId`. + */ + groupId?: string; + }; + }): CancelablePromise<{ + category: Category; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/servers/{serverId}/categories", + path: { + serverId: serverId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Read a category - * @returns any Success - * @throws ApiError - */ - public categoryRead({ serverId, categoryId }: { serverId: string; categoryId: number }): CancelablePromise<{ - category: Category; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/categories/{categoryId}", - path: { - serverId: serverId, - categoryId: categoryId, - }, - }); - } + /** + * Read a category + * @returns any Success + * @throws ApiError + */ + public categoryRead({ + serverId, + categoryId, + }: { + serverId: string; + categoryId: number; + }): CancelablePromise<{ + category: Category; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/categories/{categoryId}", + path: { + serverId: serverId, + categoryId: categoryId, + }, + }, + ); + } - /** - * Update a category - * @returns any Success - * @throws ApiError - */ - public categoryUpdate({ - serverId, - categoryId, - requestBody, - }: { - serverId: string; - categoryId: number; - requestBody: { - /** - * Name of the category - */ - name: string; - }; - }): CancelablePromise<{ - category: Category; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/servers/{serverId}/categories/{categoryId}", - path: { - serverId: serverId, - categoryId: categoryId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a category + * @returns any Success + * @throws ApiError + */ + public categoryUpdate({ + serverId, + categoryId, + requestBody, + }: { + serverId: string; + categoryId: number; + requestBody: { + /** + * Name of the category + */ + name: string; + }; + }): CancelablePromise<{ + category: Category; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/servers/{serverId}/categories/{categoryId}", + path: { + serverId: serverId, + categoryId: categoryId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a category - * @returns any Success - * @throws ApiError - */ - public categoryDelete({ serverId, categoryId }: { serverId: string; categoryId: number }): CancelablePromise<{ - category: Category; - }> { - return this.httpRequest.request({ - method: "DELETE", - url: "/servers/{serverId}/categories/{categoryId}", - path: { - serverId: serverId, - categoryId: categoryId, - }, - }); - } + /** + * Delete a category + * @returns any Success + * @throws ApiError + */ + public categoryDelete({ + serverId, + categoryId, + }: { + serverId: string; + categoryId: number; + }): CancelablePromise<{ + category: Category; + }> { + return this.httpRequest.request( + { + method: "DELETE", + url: "/servers/{serverId}/categories/{categoryId}", + path: { + serverId: serverId, + categoryId: categoryId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/ChannelsService.ts b/packages/api/lib/generated/router/services/ChannelsService.ts index 7807505b..908e8551 100644 --- a/packages/api/lib/generated/router/services/ChannelsService.ts +++ b/packages/api/lib/generated/router/services/ChannelsService.ts @@ -4,178 +4,225 @@ /* eslint-disable */ import type { ServerChannel } from "../models/ServerChannel"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class ChannelsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a channel - * Only server channels are supported at this time (coming soon™: DM Channels!) - * @returns any Success - * @throws ApiError - */ - public channelCreate({ - requestBody, - }: { - requestBody: { - /** - * The name of the channel - */ - name: string; - /** - * The topic of the channel. Not applicable to threads - */ - topic?: string; - /** - * [DEPRECATED - use `visibility` instead] Whether the channel can be accessed from users who are not member of the server. Not applicable to threads - */ - isPublic?: boolean; - /** - * What users can access the channel. Only applicable to server channels. If not present, this channel will respect normal permissions. `public` is accessible to everyone, even those who aren't of the server. `private` is only accessible to explicitly mentioned users. Currently, threads cannot be `public` and other channels cannot be `private`. Additionally, `private` threads can only exist with an associated `messageId` that is for a private message - */ - visibility?: "private" | "public" | null; - /** - * The type of channel. This will determine what routes to use for creating content in a channel. For example, if this "chat", then one must use the routes for creating channel messages. For threads, this **must** be "chat" for now - */ - type: "announcements" | "chat" | "calendar" | "forums" | "media" | "docs" | "voice" | "list" | "scheduling" | "stream"; - /** - * The ID of the server. Optional if providing a `groupId`, `categoryId`, `parentId` or `messageId` - */ - serverId?: string; - /** - * The ID of the group. If not provided, channel will be created in the "Server home" group from `serverId` _or_ in the group that corresponds to the `categoryId` parameter. Optional if providing a `groupId`, `categoryId`, `parentId` or `messageId` - */ - groupId?: string; - /** - * The category that the channel exists in. Only relevant for server channels. If not provided, channel will be a top-level channel. Optional if providing a `parentId` or `messageId` - */ - categoryId?: number; - /** - * ID of the **immediate** parent channel or thread in the channel hierarchy. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present. Optional if providing a `messageId` - */ - parentId?: string; - /** - * The ID of the message that this channel was created off of. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present - */ - messageId?: string; - }; - }): CancelablePromise<{ - channel: ServerChannel; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/channels", - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a channel + * Only server channels are supported at this time (coming soon™: DM Channels!) + * @returns any Success + * @throws ApiError + */ + public channelCreate({ + requestBody, + }: { + requestBody: { + /** + * The name of the channel + */ + name: string; + /** + * The topic of the channel. Not applicable to threads + */ + topic?: string; + /** + * [DEPRECATED - use `visibility` instead] Whether the channel can be accessed from users who are not member of the server. Not applicable to threads + */ + isPublic?: boolean; + /** + * What users can access the channel. Only applicable to server channels. If not present, this channel will respect normal permissions. `public` is accessible to everyone, even those who aren't of the server. `private` is only accessible to explicitly mentioned users. Currently, threads cannot be `public` and other channels cannot be `private`. Additionally, `private` threads can only exist with an associated `messageId` that is for a private message + */ + visibility?: + | "private" + | "public" + | null; + /** + * The type of channel. This will determine what routes to use for creating content in a channel. For example, if this "chat", then one must use the routes for creating channel messages. For threads, this **must** be "chat" for now + */ + type: + | "announcements" + | "chat" + | "calendar" + | "forums" + | "media" + | "docs" + | "voice" + | "list" + | "scheduling" + | "stream"; + /** + * The ID of the server. Optional if providing a `groupId`, `categoryId`, `parentId` or `messageId` + */ + serverId?: string; + /** + * The ID of the group. If not provided, channel will be created in the "Server home" group from `serverId` _or_ in the group that corresponds to the `categoryId` parameter. Optional if providing a `groupId`, `categoryId`, `parentId` or `messageId` + */ + groupId?: string; + /** + * The category that the channel exists in. Only relevant for server channels. If not provided, channel will be a top-level channel. Optional if providing a `parentId` or `messageId` + */ + categoryId?: number; + /** + * ID of the **immediate** parent channel or thread in the channel hierarchy. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present. Optional if providing a `messageId` + */ + parentId?: string; + /** + * The ID of the message that this channel was created off of. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present + */ + messageId?: string; + }; + }): CancelablePromise<{ + channel: ServerChannel; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/channels", + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get a channel - * Must be a member of the server to get the channel. Only server channels are supported at this time (coming soon™: DM Channels!) - * @returns any Success - * @throws ApiError - */ - public channelRead({ channelId }: { channelId: string }): CancelablePromise<{ - channel: ServerChannel; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}", - path: { - channelId: channelId, - }, - }); - } + /** + * Get a channel + * Must be a member of the server to get the channel. Only server channels are supported at this time (coming soon™: DM Channels!) + * @returns any Success + * @throws ApiError + */ + public channelRead({ + channelId, + }: { + channelId: string; + }): CancelablePromise<{ + channel: ServerChannel; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}", + path: { + channelId: channelId, + }, + }, + ); + } - /** - * Update a channel - * Only server channels are supported at this time (coming soon™: DM Channels!) - * @returns any Success - * @throws ApiError - */ - public channelUpdate({ - channelId, - requestBody, - }: { - channelId: string; - requestBody: { - /** - * The name of the channel or thread - */ - name?: string; - /** - * The topic of the channel. Not applicable to threads - */ - topic?: string | null; - /** - * [DEPRECATED - use `visibility` instead] Whether the channel can be accessed from users who are not member of the server. Not applicable to threads - */ - isPublic?: boolean; - /** - * What users can access the channel. Only applicable to server channels. If not present, this channel will respect normal permissions. `public` is accessible to everyone, even those who aren't of the server. `private` is only accessible to explicitly mentioned users. Currently, threads cannot be `public` and other channels cannot be `private`. Additionally, `private` threads can only exist with an associated `messageId` that is for a private message. At this time, you cannot update the visibility on a channel to `private`; this must be set at creation - */ - visibility?: "public" | null; - }; - }): CancelablePromise<{ - channel: ServerChannel; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/channels/{channelId}", - path: { - channelId: channelId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a channel + * Only server channels are supported at this time (coming soon™: DM Channels!) + * @returns any Success + * @throws ApiError + */ + public channelUpdate({ + channelId, + requestBody, + }: { + channelId: string; + requestBody: { + /** + * The name of the channel or thread + */ + name?: string; + /** + * The topic of the channel. Not applicable to threads + */ + topic?: + | string + | null; + /** + * [DEPRECATED - use `visibility` instead] Whether the channel can be accessed from users who are not member of the server. Not applicable to threads + */ + isPublic?: boolean; + /** + * What users can access the channel. Only applicable to server channels. If not present, this channel will respect normal permissions. `public` is accessible to everyone, even those who aren't of the server. `private` is only accessible to explicitly mentioned users. Currently, threads cannot be `public` and other channels cannot be `private`. Additionally, `private` threads can only exist with an associated `messageId` that is for a private message. At this time, you cannot update the visibility on a channel to `private`; this must be set at creation + */ + visibility?: + | "public" + | null; + }; + }): CancelablePromise<{ + channel: ServerChannel; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/channels/{channelId}", + path: { + channelId: channelId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a channel - * Only server channels are supported at this time (coming soon™: DM Channels!) - * @returns void - * @throws ApiError - */ - public channelDelete({ channelId }: { channelId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}", - path: { - channelId: channelId, - }, - }); - } + /** + * Delete a channel + * Only server channels are supported at this time (coming soon™: DM Channels!) + * @returns void + * @throws ApiError + */ + public channelDelete({ + channelId, + }: { + channelId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}", + path: { + channelId: channelId, + }, + }, + ); + } - /** - * Archive a channel - * @returns void - * @throws ApiError - */ - public channelArchiveCreate({ channelId }: { channelId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/archive", - path: { - channelId: channelId, - }, - }); - } + /** + * Archive a channel + * @returns void + * @throws ApiError + */ + public channelArchiveCreate({ + channelId, + }: { + channelId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/archive", + path: { + channelId: channelId, + }, + }, + ); + } - /** - * Restore an archived channel - * @returns void - * @throws ApiError - */ - public channelArchiveDelete({ channelId }: { channelId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/archive", - path: { - channelId: channelId, - }, - }); - } + /** + * Restore an archived channel + * @returns void + * @throws ApiError + */ + public channelArchiveDelete({ + channelId, + }: { + channelId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/archive", + path: { + channelId: channelId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/ChatService.ts b/packages/api/lib/generated/router/services/ChatService.ts index 8e15d3db..9c69966f 100644 --- a/packages/api/lib/generated/router/services/ChatService.ts +++ b/packages/api/lib/generated/router/services/ChatService.ts @@ -6,275 +6,316 @@ import type { ChatEmbed } from "../models/ChatEmbed"; import type { ChatMessage } from "../models/ChatMessage"; import type { Mentions } from "../models/Mentions"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class ChatService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a channel message - * @returns any Success - * @throws ApiError - */ - public channelMessageCreate({ - channelId, - requestBody, - }: { - /** - * Channel ID to create the message in - */ - channelId: string; - requestBody: { - /** - * If set, this message will only be seen by those mentioned or replied to - */ - isPrivate?: boolean; - /** - * If set, this message will not notify any mentioned users or roles - */ - isSilent?: boolean; - /** - * Message IDs to reply to - */ - replyMessageIds?: Array; - /** - * The content of the message - */ - content?: string; - /** - * At this time, only one embed is supported per message, and attachments are not supported. If you need to send more than one embed or upload attachments, consider creating the message via a webhook. - */ - embeds?: Array; - }; - }): CancelablePromise<{ - message: ChatMessage; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/messages", - path: { - channelId: channelId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a channel message + * @returns any Success + * @throws ApiError + */ + public channelMessageCreate({ + channelId, + requestBody, + }: { + /** + * Channel ID to create the message in + */ + channelId: string; + requestBody: { + /** + * If set, this message will only be seen by those mentioned or replied to + */ + isPrivate?: boolean; + /** + * If set, this message will not notify any mentioned users or roles + */ + isSilent?: boolean; + /** + * Message IDs to reply to + */ + replyMessageIds?: Array; + /** + * The content of the message + */ + content?: string; + /** + * At this time, only one embed is supported per message, and attachments are not supported. If you need to send more than one embed or upload attachments, consider creating the message via a webhook. + */ + embeds?: Array; + }; + }): CancelablePromise<{ + message: ChatMessage; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/messages", + path: { + channelId: channelId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get channel messages - * Results returned will be ordered ascending by the message's `createdAt`. `before` and `after` will filter based on the message's `createdAt` - * @returns any Success - * @throws ApiError - */ - public channelMessageReadMany({ - channelId, - before, - after, - limit = 50, - includePrivate = false, - }: { - /** - * ID of the channel that the messages exist in - */ - channelId: string; - before?: string; - /** - * An ISO 8601 timestamp that will be used to filter out results for the current page. Order will be reversed when compared to `before` or when omitting this parameter altogether - */ - after?: string; - limit?: number; - /** - * Whether to include private messages between all users in response - */ - includePrivate?: boolean; - }): CancelablePromise<{ - messages: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/messages", - path: { - channelId: channelId, - }, - query: { - before: before, - after: after, - limit: limit, - includePrivate: includePrivate, - }, - }); - } + /** + * Get channel messages + * Results returned will be ordered ascending by the message's `createdAt`. `before` and `after` will filter based on the message's `createdAt` + * @returns any Success + * @throws ApiError + */ + public channelMessageReadMany({ + channelId, + before, + after, + limit = 50, + includePrivate = false, + }: { + /** + * ID of the channel that the messages exist in + */ + channelId: string; + before?: string; + /** + * An ISO 8601 timestamp that will be used to filter out results for the current page. Order will be reversed when compared to `before` or when omitting this parameter altogether + */ + after?: string; + limit?: number; + /** + * Whether to include private messages between all users in response + */ + includePrivate?: boolean; + }): CancelablePromise<{ + messages: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/messages", + path: { + channelId: channelId, + }, + query: { + before: before, + after: after, + limit: limit, + includePrivate: includePrivate, + }, + }, + ); + } - /** - * Get a channel message - * Get details for a specific chat message from a chat channel. - * @returns any Success - * @throws ApiError - */ - public channelMessageRead({ - channelId, - messageId, - }: { - /** - * ID of the channel that the message exists in - */ - channelId: string; - messageId: string; - }): CancelablePromise<{ - message: ChatMessage; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/messages/{messageId}", - path: { - channelId: channelId, - messageId: messageId, - }, - }); - } + /** + * Get a channel message + * Get details for a specific chat message from a chat channel. + * @returns any Success + * @throws ApiError + */ + public channelMessageRead({ + channelId, + messageId, + }: { + /** + * ID of the channel that the message exists in + */ + channelId: string; + messageId: string; + }): CancelablePromise<{ + message: ChatMessage; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/messages/{messageId}", + path: { + channelId: channelId, + messageId: messageId, + }, + }, + ); + } - /** - * Update a channel message - * @returns any Success - * @throws ApiError - */ - public channelMessageUpdate({ - channelId, - messageId, - requestBody, - }: { - /** - * ID of the channel that the message to be updated exists in - */ - channelId: string; - messageId: string; - requestBody: { - /** - * The content of the message - */ - content?: Record | string; - /** - * At this time, only one embed is supported per message, and attachments are not supported. If you need to send more than one embed or upload attachments, consider creating the message via a webhook. - */ - embeds?: Array; - }; - }): CancelablePromise<{ - message: ChatMessage & { - /** - * The ID of the message - */ - id?: string; - /** - * The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated. - */ - type?: "default" | "system"; - /** - * The ID of the server - */ - serverId?: string; - /** - * The ID of the group - */ - groupId?: string; - /** - * The ID of the channel - */ - channelId?: string; - /** - * The content of the message - */ - content?: string; - embeds?: Array; - /** - * Message IDs that were replied to - */ - replyMessageIds?: Array; - /** - * If set, this message will only be seen by those mentioned or replied to - */ - isPrivate?: boolean; - /** - * If set, this message did not notify mention or reply recipients - */ - isSilent?: boolean; - isPinned?: boolean; - mentions?: Mentions; - /** - * The ISO 8601 timestamp that the message was created at - */ - createdAt?: string; - /** - * The ID of the user who created this message (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) - */ - createdBy?: string; - /** - * The ID of the webhook who created this message, if it was created by a webhook - */ - createdByWebhookId?: string; - /** - * The ISO 8601 timestamp that the message was updated at, if relevant - */ - updatedAt: string; - }; - }> { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/messages/{messageId}", - path: { - channelId: channelId, - messageId: messageId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a channel message + * @returns any Success + * @throws ApiError + */ + public channelMessageUpdate({ + channelId, + messageId, + requestBody, + }: { + /** + * ID of the channel that the message to be updated exists in + */ + channelId: string; + messageId: string; + requestBody: { + /** + * The content of the message + */ + content?: + | Record< + string, + any + > + | string; + /** + * At this time, only one embed is supported per message, and attachments are not supported. If you need to send more than one embed or upload attachments, consider creating the message via a webhook. + */ + embeds?: Array; + }; + }): CancelablePromise<{ + message: ChatMessage & { + /** + * The ID of the message + */ + id?: string; + /** + * The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated. + */ + type?: + | "default" + | "system"; + /** + * The ID of the server + */ + serverId?: string; + /** + * The ID of the group + */ + groupId?: string; + /** + * The ID of the channel + */ + channelId?: string; + /** + * The content of the message + */ + content?: string; + embeds?: Array; + /** + * Message IDs that were replied to + */ + replyMessageIds?: Array; + /** + * If set, this message will only be seen by those mentioned or replied to + */ + isPrivate?: boolean; + /** + * If set, this message did not notify mention or reply recipients + */ + isSilent?: boolean; + isPinned?: boolean; + mentions?: Mentions; + /** + * The ISO 8601 timestamp that the message was created at + */ + createdAt?: string; + /** + * The ID of the user who created this message (Note: If this event has `createdByWebhookId` present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) + */ + createdBy?: string; + /** + * The ID of the webhook who created this message, if it was created by a webhook + */ + createdByWebhookId?: string; + /** + * The ISO 8601 timestamp that the message was updated at, if relevant + */ + updatedAt: string; + }; + }> { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/messages/{messageId}", + path: { + channelId: channelId, + messageId: messageId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a channel message - * @returns void - * @throws ApiError - */ - public channelMessageDelete({ channelId, messageId }: { channelId: string; messageId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/messages/{messageId}", - path: { - channelId: channelId, - messageId: messageId, - }, - }); - } + /** + * Delete a channel message + * @returns void + * @throws ApiError + */ + public channelMessageDelete({ + channelId, + messageId, + }: { + channelId: string; + messageId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/messages/{messageId}", + path: { + channelId: channelId, + messageId: messageId, + }, + }, + ); + } - /** - * Pin a message - * @returns void - * @throws ApiError - */ - public channelMessagePinCreate({ channelId, messageId }: { channelId: string; messageId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/messages/{messageId}/pin", - path: { - channelId: channelId, - messageId: messageId, - }, - }); - } + /** + * Pin a message + * @returns void + * @throws ApiError + */ + public channelMessagePinCreate({ + channelId, + messageId, + }: { + channelId: string; + messageId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/messages/{messageId}/pin", + path: { + channelId: channelId, + messageId: messageId, + }, + }, + ); + } - /** - * Unpin a message - * @returns void - * @throws ApiError - */ - public channelMessagePinDelete({ channelId, messageId }: { channelId: string; messageId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/messages/{messageId}/pin", - path: { - channelId: channelId, - messageId: messageId, - }, - }); - } + /** + * Unpin a message + * @returns void + * @throws ApiError + */ + public channelMessagePinDelete({ + channelId, + messageId, + }: { + channelId: string; + messageId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/messages/{messageId}/pin", + path: { + channelId: channelId, + messageId: messageId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/DocCommentsService.ts b/packages/api/lib/generated/router/services/DocCommentsService.ts index 919ab510..762e770e 100644 --- a/packages/api/lib/generated/router/services/DocCommentsService.ts +++ b/packages/api/lib/generated/router/services/DocCommentsService.ts @@ -4,132 +4,166 @@ /* eslint-disable */ import type { DocComment } from "../models/DocComment"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class DocCommentsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a comment on a doc - * @returns any Success - * @throws ApiError - */ - public docCommentCreate({ - channelId, - docId, - requestBody, - }: { - channelId: string; - docId: number; - requestBody: { - /** - * The content of the doc comment - */ - content: string; - }; - }): CancelablePromise<{ - docComment: DocComment; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/docs/{docId}/comments", - path: { - channelId: channelId, - docId: docId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a comment on a doc + * @returns any Success + * @throws ApiError + */ + public docCommentCreate({ + channelId, + docId, + requestBody, + }: { + channelId: string; + docId: number; + requestBody: { + /** + * The content of the doc comment + */ + content: string; + }; + }): CancelablePromise<{ + docComment: DocComment; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/docs/{docId}/comments", + path: { + channelId: channelId, + docId: docId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get a doc's comments - * @returns any Success - * @throws ApiError - */ - public docCommentReadMany({ channelId, docId }: { channelId: string; docId: number }): CancelablePromise<{ - docComments: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/docs/{docId}/comments", - path: { - channelId: channelId, - docId: docId, - }, - }); - } + /** + * Get a doc's comments + * @returns any Success + * @throws ApiError + */ + public docCommentReadMany({ + channelId, + docId, + }: { + channelId: string; + docId: number; + }): CancelablePromise<{ + docComments: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/docs/{docId}/comments", + path: { + channelId: channelId, + docId: docId, + }, + }, + ); + } - /** - * Get a comment on a doc - * @returns any Success - * @throws ApiError - */ - public docCommentRead({ channelId, docId, docCommentId }: { channelId: string; docId: number; docCommentId: number }): CancelablePromise<{ - docComment: DocComment; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/docs/{docId}/comments/{docCommentId}", - path: { - channelId: channelId, - docId: docId, - docCommentId: docCommentId, - }, - }); - } + /** + * Get a comment on a doc + * @returns any Success + * @throws ApiError + */ + public docCommentRead({ + channelId, + docId, + docCommentId, + }: { + channelId: string; + docId: number; + docCommentId: number; + }): CancelablePromise<{ + docComment: DocComment; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/docs/{docId}/comments/{docCommentId}", + path: { + channelId: channelId, + docId: docId, + docCommentId: docCommentId, + }, + }, + ); + } - /** - * Update a doc comment - * @returns any Success - * @throws ApiError - */ - public docCommentUpdate({ - channelId, - docId, - docCommentId, - requestBody, - }: { - channelId: string; - docId: number; - docCommentId: number; - requestBody: { - /** - * The content of the doc comment - */ - content: string; - }; - }): CancelablePromise<{ - docComment: DocComment; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/channels/{channelId}/docs/{docId}/comments/{docCommentId}", - path: { - channelId: channelId, - docId: docId, - docCommentId: docCommentId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a doc comment + * @returns any Success + * @throws ApiError + */ + public docCommentUpdate({ + channelId, + docId, + docCommentId, + requestBody, + }: { + channelId: string; + docId: number; + docCommentId: number; + requestBody: { + /** + * The content of the doc comment + */ + content: string; + }; + }): CancelablePromise<{ + docComment: DocComment; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/channels/{channelId}/docs/{docId}/comments/{docCommentId}", + path: { + channelId: channelId, + docId: docId, + docCommentId: docCommentId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a doc comment - * @returns void - * @throws ApiError - */ - public docCommentDelete({ channelId, docId, docCommentId }: { channelId: string; docId: number; docCommentId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/docs/{docId}/comments/{docCommentId}", - path: { - channelId: channelId, - docId: docId, - docCommentId: docCommentId, - }, - }); - } + /** + * Delete a doc comment + * @returns void + * @throws ApiError + */ + public docCommentDelete({ + channelId, + docId, + docCommentId, + }: { + channelId: string; + docId: number; + docCommentId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/docs/{docId}/comments/{docCommentId}", + path: { + channelId: channelId, + docId: docId, + docCommentId: docCommentId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/DocsService.ts b/packages/api/lib/generated/router/services/DocsService.ts index f9839393..9fb3749b 100644 --- a/packages/api/lib/generated/router/services/DocsService.ts +++ b/packages/api/lib/generated/router/services/DocsService.ts @@ -4,136 +4,173 @@ /* eslint-disable */ import type { Doc } from "../models/Doc"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class DocsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a doc - * @returns any Success - * @throws ApiError - */ - public docCreate({ - channelId, - requestBody, - }: { - channelId: string; - requestBody: { - /** - * The title of the doc - */ - title: string; - /** - * The content of the doc - */ - content: Record | string; - }; - }): CancelablePromise<{ - doc: Doc; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/docs", - path: { - channelId: channelId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a doc + * @returns any Success + * @throws ApiError + */ + public docCreate({ + channelId, + requestBody, + }: { + channelId: string; + requestBody: { + /** + * The title of the doc + */ + title: string; + /** + * The content of the doc + */ + content: + | Record< + string, + any + > + | string; + }; + }): CancelablePromise<{ + doc: Doc; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/docs", + path: { + channelId: channelId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get docs - * Results returned will be ordered descending by the doc's `updatedAt`. `before` will filter based on the doc's `updatedAt` - * @returns any Success - * @throws ApiError - */ - public docReadMany({ channelId, before, limit = 25 }: { channelId: string; before?: string; limit?: number }): CancelablePromise<{ - docs: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/docs", - path: { - channelId: channelId, - }, - query: { - before: before, - limit: limit, - }, - }); - } + /** + * Get docs + * Results returned will be ordered descending by the doc's `updatedAt`. `before` will filter based on the doc's `updatedAt` + * @returns any Success + * @throws ApiError + */ + public docReadMany({ + channelId, + before, + limit = 25, + }: { + channelId: string; + before?: string; + limit?: number; + }): CancelablePromise<{ + docs: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/docs", + path: { + channelId: channelId, + }, + query: { + before: before, + limit: limit, + }, + }, + ); + } - /** - * Get a doc - * @returns any Success - * @throws ApiError - */ - public docRead({ channelId, docId }: { channelId: string; docId: number }): CancelablePromise<{ - doc: Doc; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/docs/{docId}", - path: { - channelId: channelId, - docId: docId, - }, - }); - } + /** + * Get a doc + * @returns any Success + * @throws ApiError + */ + public docRead({ + channelId, + docId, + }: { + channelId: string; + docId: number; + }): CancelablePromise<{ + doc: Doc; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/docs/{docId}", + path: { + channelId: channelId, + docId: docId, + }, + }, + ); + } - /** - * Update a doc - * @returns any Success - * @throws ApiError - */ - public docUpdate({ - channelId, - docId, - requestBody, - }: { - channelId: string; - docId: number; - requestBody: { - /** - * The title of the doc - */ - title: string; - /** - * The content of the doc - */ - content: string; - }; - }): CancelablePromise<{ - doc: Doc; - }> { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/docs/{docId}", - path: { - channelId: channelId, - docId: docId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a doc + * @returns any Success + * @throws ApiError + */ + public docUpdate({ + channelId, + docId, + requestBody, + }: { + channelId: string; + docId: number; + requestBody: { + /** + * The title of the doc + */ + title: string; + /** + * The content of the doc + */ + content: string; + }; + }): CancelablePromise<{ + doc: Doc; + }> { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/docs/{docId}", + path: { + channelId: channelId, + docId: docId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a doc - * @returns void - * @throws ApiError - */ - public docDelete({ channelId, docId }: { channelId: string; docId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/docs/{docId}", - path: { - channelId: channelId, - docId: docId, - }, - }); - } + /** + * Delete a doc + * @returns void + * @throws ApiError + */ + public docDelete({ + channelId, + docId, + }: { + channelId: string; + docId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/docs/{docId}", + path: { + channelId: channelId, + docId: docId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/ForumCommentsService.ts b/packages/api/lib/generated/router/services/ForumCommentsService.ts index 481df100..5c5c5eb7 100644 --- a/packages/api/lib/generated/router/services/ForumCommentsService.ts +++ b/packages/api/lib/generated/router/services/ForumCommentsService.ts @@ -4,132 +4,166 @@ /* eslint-disable */ import type { ForumTopicComment } from "../models/ForumTopicComment"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class ForumCommentsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a forum topic comment - * @returns any Success - * @throws ApiError - */ - public forumTopicCommentCreate({ - channelId, - forumTopicId, - requestBody, - }: { - channelId: string; - forumTopicId: number; - requestBody: { - /** - * The content of the forum topic comment - */ - content: string; - }; - }): CancelablePromise<{ - forumTopicComment: ForumTopicComment; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/topics/{forumTopicId}/comments", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a forum topic comment + * @returns any Success + * @throws ApiError + */ + public forumTopicCommentCreate({ + channelId, + forumTopicId, + requestBody, + }: { + channelId: string; + forumTopicId: number; + requestBody: { + /** + * The content of the forum topic comment + */ + content: string; + }; + }): CancelablePromise<{ + forumTopicComment: ForumTopicComment; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/topics/{forumTopicId}/comments", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get a forum topic's comments - * @returns any Success - * @throws ApiError - */ - public forumTopicCommentReadMany({ channelId, forumTopicId }: { channelId: string; forumTopicId: number }): CancelablePromise<{ - forumTopicComments: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/topics/{forumTopicId}/comments", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - }, - }); - } + /** + * Get a forum topic's comments + * @returns any Success + * @throws ApiError + */ + public forumTopicCommentReadMany({ + channelId, + forumTopicId, + }: { + channelId: string; + forumTopicId: number; + }): CancelablePromise<{ + forumTopicComments: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/topics/{forumTopicId}/comments", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + }, + }, + ); + } - /** - * Get a comment on a forum topic - * @returns any Success - * @throws ApiError - */ - public forumTopicCommentRead({ channelId, forumTopicId, forumTopicCommentId }: { channelId: string; forumTopicId: number; forumTopicCommentId: number }): CancelablePromise<{ - forumTopicComment: ForumTopicComment; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/topics/{forumTopicId}/comments/{forumTopicCommentId}", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - forumTopicCommentId: forumTopicCommentId, - }, - }); - } + /** + * Get a comment on a forum topic + * @returns any Success + * @throws ApiError + */ + public forumTopicCommentRead({ + channelId, + forumTopicId, + forumTopicCommentId, + }: { + channelId: string; + forumTopicId: number; + forumTopicCommentId: number; + }): CancelablePromise<{ + forumTopicComment: ForumTopicComment; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/topics/{forumTopicId}/comments/{forumTopicCommentId}", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + forumTopicCommentId: forumTopicCommentId, + }, + }, + ); + } - /** - * Update a forum topic comment - * @returns any Success - * @throws ApiError - */ - public forumTopicCommentUpdate({ - channelId, - forumTopicId, - forumTopicCommentId, - requestBody, - }: { - channelId: string; - forumTopicId: number; - forumTopicCommentId: number; - requestBody: { - /** - * The content of the forum topic - */ - content?: string; - }; - }): CancelablePromise<{ - forumTopicComment: ForumTopicComment; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/channels/{channelId}/topics/{forumTopicId}/comments/{forumTopicCommentId}", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - forumTopicCommentId: forumTopicCommentId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a forum topic comment + * @returns any Success + * @throws ApiError + */ + public forumTopicCommentUpdate({ + channelId, + forumTopicId, + forumTopicCommentId, + requestBody, + }: { + channelId: string; + forumTopicId: number; + forumTopicCommentId: number; + requestBody: { + /** + * The content of the forum topic + */ + content?: string; + }; + }): CancelablePromise<{ + forumTopicComment: ForumTopicComment; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/channels/{channelId}/topics/{forumTopicId}/comments/{forumTopicCommentId}", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + forumTopicCommentId: forumTopicCommentId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a forum topic comment - * @returns void - * @throws ApiError - */ - public forumTopicCommentDelete({ channelId, forumTopicId, forumTopicCommentId }: { channelId: string; forumTopicId: number; forumTopicCommentId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/topics/{forumTopicId}/comments/{forumTopicCommentId}", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - forumTopicCommentId: forumTopicCommentId, - }, - }); - } + /** + * Delete a forum topic comment + * @returns void + * @throws ApiError + */ + public forumTopicCommentDelete({ + channelId, + forumTopicId, + forumTopicCommentId, + }: { + channelId: string; + forumTopicId: number; + forumTopicCommentId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/topics/{forumTopicId}/comments/{forumTopicCommentId}", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + forumTopicCommentId: forumTopicCommentId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/ForumsService.ts b/packages/api/lib/generated/router/services/ForumsService.ts index ddcdafa3..69d4b092 100644 --- a/packages/api/lib/generated/router/services/ForumsService.ts +++ b/packages/api/lib/generated/router/services/ForumsService.ts @@ -5,199 +5,268 @@ import type { ForumTopic } from "../models/ForumTopic"; import type { ForumTopicSummary } from "../models/ForumTopicSummary"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class ForumsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a topic in a forum - * @returns any Success - * @throws ApiError - */ - public forumTopicCreate({ - channelId, - requestBody, - }: { - channelId: string; - requestBody: { - /** - * The title of the forum topic - */ - title: string; - /** - * The content of the forum topic - */ - content: Record | string; - }; - }): CancelablePromise<{ - forumTopic: ForumTopic; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/topics", - path: { - channelId: channelId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a topic in a forum + * @returns any Success + * @throws ApiError + */ + public forumTopicCreate({ + channelId, + requestBody, + }: { + channelId: string; + requestBody: { + /** + * The title of the forum topic + */ + title: string; + /** + * The content of the forum topic + */ + content: + | Record< + string, + any + > + | string; + }; + }): CancelablePromise<{ + forumTopic: ForumTopic; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/topics", + path: { + channelId: channelId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get forum topics - * @returns any Success - * @throws ApiError - */ - public forumTopicReadMany({ channelId, before, limit = 25 }: { channelId: string; before?: string; limit?: number }): CancelablePromise<{ - forumTopics: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/topics", - path: { - channelId: channelId, - }, - query: { - before: before, - limit: limit, - }, - }); - } + /** + * Get forum topics + * @returns any Success + * @throws ApiError + */ + public forumTopicReadMany({ + channelId, + before, + limit = 25, + }: { + channelId: string; + before?: string; + limit?: number; + }): CancelablePromise<{ + forumTopics: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/topics", + path: { + channelId: channelId, + }, + query: { + before: before, + limit: limit, + }, + }, + ); + } - /** - * Get a forum topic - * @returns any Success - * @throws ApiError - */ - public forumTopicRead({ channelId, forumTopicId }: { channelId: string; forumTopicId: number }): CancelablePromise<{ - forumTopic: ForumTopic; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/topics/{forumTopicId}", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - }, - }); - } + /** + * Get a forum topic + * @returns any Success + * @throws ApiError + */ + public forumTopicRead({ + channelId, + forumTopicId, + }: { + channelId: string; + forumTopicId: number; + }): CancelablePromise<{ + forumTopic: ForumTopic; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/topics/{forumTopicId}", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + }, + }, + ); + } - /** - * Update a forum topic - * @returns any Success - * @throws ApiError - */ - public forumTopicUpdate({ - channelId, - forumTopicId, - requestBody, - }: { - channelId: string; - forumTopicId: number; - requestBody: { - /** - * The title of the forum topic - */ - title?: string; - /** - * The content of the forum topic - */ - content?: string; - }; - }): CancelablePromise<{ - forumTopic: ForumTopic; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/channels/{channelId}/topics/{forumTopicId}", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a forum topic + * @returns any Success + * @throws ApiError + */ + public forumTopicUpdate({ + channelId, + forumTopicId, + requestBody, + }: { + channelId: string; + forumTopicId: number; + requestBody: { + /** + * The title of the forum topic + */ + title?: string; + /** + * The content of the forum topic + */ + content?: string; + }; + }): CancelablePromise<{ + forumTopic: ForumTopic; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/channels/{channelId}/topics/{forumTopicId}", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a forum topic - * @returns void - * @throws ApiError - */ - public forumTopicDelete({ channelId, forumTopicId }: { channelId: string; forumTopicId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/topics/{forumTopicId}", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - }, - }); - } + /** + * Delete a forum topic + * @returns void + * @throws ApiError + */ + public forumTopicDelete({ + channelId, + forumTopicId, + }: { + channelId: string; + forumTopicId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/topics/{forumTopicId}", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + }, + }, + ); + } - /** - * Pin a forum topic - * @returns void - * @throws ApiError - */ - public forumTopicPin({ channelId, forumTopicId }: { channelId: string; forumTopicId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/topics/{forumTopicId}/pin", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - }, - }); - } + /** + * Pin a forum topic + * @returns void + * @throws ApiError + */ + public forumTopicPin({ + channelId, + forumTopicId, + }: { + channelId: string; + forumTopicId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/topics/{forumTopicId}/pin", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + }, + }, + ); + } - /** - * Unpin a forum topic - * @returns void - * @throws ApiError - */ - public forumTopicUnpin({ channelId, forumTopicId }: { channelId: string; forumTopicId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/topics/{forumTopicId}/pin", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - }, - }); - } + /** + * Unpin a forum topic + * @returns void + * @throws ApiError + */ + public forumTopicUnpin({ + channelId, + forumTopicId, + }: { + channelId: string; + forumTopicId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/topics/{forumTopicId}/pin", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + }, + }, + ); + } - /** - * Lock a forum topic - * @returns void - * @throws ApiError - */ - public forumTopicLock({ channelId, forumTopicId }: { channelId: string; forumTopicId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/topics/{forumTopicId}/lock", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - }, - }); - } + /** + * Lock a forum topic + * @returns void + * @throws ApiError + */ + public forumTopicLock({ + channelId, + forumTopicId, + }: { + channelId: string; + forumTopicId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/topics/{forumTopicId}/lock", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + }, + }, + ); + } - /** - * Unlock a forum topic - * @returns void - * @throws ApiError - */ - public forumTopicUnlock({ channelId, forumTopicId }: { channelId: string; forumTopicId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/topics/{forumTopicId}/lock", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - }, - }); - } + /** + * Unlock a forum topic + * @returns void + * @throws ApiError + */ + public forumTopicUnlock({ + channelId, + forumTopicId, + }: { + channelId: string; + forumTopicId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/topics/{forumTopicId}/lock", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/GroupMembershipService.ts b/packages/api/lib/generated/router/services/GroupMembershipService.ts index 9776e48e..bfd86861 100644 --- a/packages/api/lib/generated/router/services/GroupMembershipService.ts +++ b/packages/api/lib/generated/router/services/GroupMembershipService.ts @@ -1,66 +1,76 @@ +import type { BaseHttpRequest } from "../core/BaseHttpRequest"; /* generated using openapi-typescript-codegen -- do no edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { CancelablePromise } from "../core/CancelablePromise"; -import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export class GroupMembershipService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Add member to group - * @returns void - * @throws ApiError - */ - public groupMembershipCreate({ - groupId, - userId, - }: { - /** - * Group ID to add the member to - */ - groupId: string; - /** - * Member ID to add to the group - */ - userId: string | "@me"; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/groups/{groupId}/members/{userId}", - path: { - groupId: groupId, - userId: userId, - }, - }); - } + /** + * Add member to group + * @returns void + * @throws ApiError + */ + public groupMembershipCreate({ + groupId, + userId, + }: { + /** + * Group ID to add the member to + */ + groupId: string; + /** + * Member ID to add to the group + */ + userId: + | string + | "@me"; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/groups/{groupId}/members/{userId}", + path: { + groupId: groupId, + userId: userId, + }, + }, + ); + } - /** - * Remove member from group - * @returns void - * @throws ApiError - */ - public groupMembershipDelete({ - groupId, - userId, - }: { - /** - * Group ID to remove the member from - */ - groupId: string; - /** - * Member ID to remove from the group - */ - userId: string | "@me"; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/groups/{groupId}/members/{userId}", - path: { - groupId: groupId, - userId: userId, - }, - }); - } + /** + * Remove member from group + * @returns void + * @throws ApiError + */ + public groupMembershipDelete({ + groupId, + userId, + }: { + /** + * Group ID to remove the member from + */ + groupId: string; + /** + * Member ID to remove from the group + */ + userId: + | string + | "@me"; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/groups/{groupId}/members/{userId}", + path: { + groupId: groupId, + userId: userId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/GroupsService.ts b/packages/api/lib/generated/router/services/GroupsService.ts index 92217389..bda03b9a 100644 --- a/packages/api/lib/generated/router/services/GroupsService.ts +++ b/packages/api/lib/generated/router/services/GroupsService.ts @@ -4,151 +4,179 @@ /* eslint-disable */ import type { Group } from "../models/Group"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class GroupsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a group - * Note: only 100 unarchived groups can exist on a server at any time - * @returns any Success - * @throws ApiError - */ - public groupCreate({ - serverId, - requestBody, - }: { - serverId: string; - requestBody: { - /** - * The name of the group - */ - name: string; - /** - * The description associated with the group - */ - description?: string; - /** - * The emote to associate with the group - */ - emoteId?: number; - /** - * Is this group open for anyone to join? - */ - isPublic?: boolean; - }; - }): CancelablePromise<{ - group: Group; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/servers/{serverId}/groups", - path: { - serverId: serverId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a group + * Note: only 100 unarchived groups can exist on a server at any time + * @returns any Success + * @throws ApiError + */ + public groupCreate({ + serverId, + requestBody, + }: { + serverId: string; + requestBody: { + /** + * The name of the group + */ + name: string; + /** + * The description associated with the group + */ + description?: string; + /** + * The emote to associate with the group + */ + emoteId?: number; + /** + * Is this group open for anyone to join? + */ + isPublic?: boolean; + }; + }): CancelablePromise<{ + group: Group; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/servers/{serverId}/groups", + path: { + serverId: serverId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get groups - * @returns any Success - * @throws ApiError - */ - public groupReadMany({ serverId }: { serverId: string }): CancelablePromise<{ - groups: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/groups", - path: { - serverId: serverId, - }, - }); - } + /** + * Get groups + * @returns any Success + * @throws ApiError + */ + public groupReadMany({ + serverId, + }: { + serverId: string; + }): CancelablePromise<{ + groups: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/groups", + path: { + serverId: serverId, + }, + }, + ); + } - /** - * Get a group - * @returns any Success - * @throws ApiError - */ - public groupRead({ serverId, groupId }: { serverId: string; groupId: string }): CancelablePromise<{ - group: Group; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/groups/{groupId}", - path: { - serverId: serverId, - groupId: groupId, - }, - }); - } + /** + * Get a group + * @returns any Success + * @throws ApiError + */ + public groupRead({ + serverId, + groupId, + }: { + serverId: string; + groupId: string; + }): CancelablePromise<{ + group: Group; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/groups/{groupId}", + path: { + serverId: serverId, + groupId: groupId, + }, + }, + ); + } - /** - * Update a group - * @returns any Success - * @throws ApiError - */ - public groupUpdate({ - serverId, - groupId, - requestBody, - }: { - serverId: string; - groupId: string; - requestBody: { - /** - * The name of the group - */ - name?: string; - /** - * The description associated with the group - * **Note** - this property cannot be modified on a home group - */ - description?: string; - /** - * The emote to associate with the group - */ - emoteId?: number; - /** - * Is this group open for anyone to join? - * **Note** - this property cannot be modified on a home group - */ - isPublic?: boolean; - }; - }): CancelablePromise<{ - group: Group; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/servers/{serverId}/groups/{groupId}", - path: { - serverId: serverId, - groupId: groupId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a group + * @returns any Success + * @throws ApiError + */ + public groupUpdate({ + serverId, + groupId, + requestBody, + }: { + serverId: string; + groupId: string; + requestBody: { + /** + * The name of the group + */ + name?: string; + /** + * The description associated with the group + * **Note** - this property cannot be modified on a home group + */ + description?: string; + /** + * The emote to associate with the group + */ + emoteId?: number; + /** + * Is this group open for anyone to join? + * **Note** - this property cannot be modified on a home group + */ + isPublic?: boolean; + }; + }): CancelablePromise<{ + group: Group; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/servers/{serverId}/groups/{groupId}", + path: { + serverId: serverId, + groupId: groupId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a group - * Note: you cannot delete the home group - * @returns void - * @throws ApiError - */ - public groupDelete({ serverId, groupId }: { serverId: string; groupId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/servers/{serverId}/groups/{groupId}", - path: { - serverId: serverId, - groupId: groupId, - }, - }); - } + /** + * Delete a group + * Note: you cannot delete the home group + * @returns void + * @throws ApiError + */ + public groupDelete({ + serverId, + groupId, + }: { + serverId: string; + groupId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/servers/{serverId}/groups/{groupId}", + path: { + serverId: serverId, + groupId: groupId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/ListItemsService.ts b/packages/api/lib/generated/router/services/ListItemsService.ts index 2e2cc687..5975b092 100644 --- a/packages/api/lib/generated/router/services/ListItemsService.ts +++ b/packages/api/lib/generated/router/services/ListItemsService.ts @@ -5,167 +5,221 @@ import type { ListItem } from "../models/ListItem"; import type { ListItemSummary } from "../models/ListItemSummary"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class ListItemsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a list item - * @returns any Success - * @throws ApiError - */ - public listItemCreate({ - channelId, - requestBody, - }: { - channelId: string; - requestBody: { - /** - * The message of the list item - */ - message: Record | string; - note?: { - /** - * The note of the list item - */ - content: Record | string; - }; - }; - }): CancelablePromise<{ - listItem: ListItem; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/items", - path: { - channelId: channelId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a list item + * @returns any Success + * @throws ApiError + */ + public listItemCreate({ + channelId, + requestBody, + }: { + channelId: string; + requestBody: { + /** + * The message of the list item + */ + message: + | Record< + string, + any + > + | string; + note?: { + /** + * The note of the list item + */ + content: + | Record< + string, + any + > + | string; + }; + }; + }): CancelablePromise<{ + listItem: ListItem; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/items", + path: { + channelId: channelId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get list items within a channel - * @returns any Success - * @throws ApiError - */ - public listItemReadMany({ channelId }: { channelId: string }): CancelablePromise<{ - listItems: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/items", - path: { - channelId: channelId, - }, - }); - } + /** + * Get list items within a channel + * @returns any Success + * @throws ApiError + */ + public listItemReadMany({ + channelId, + }: { + channelId: string; + }): CancelablePromise<{ + listItems: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/items", + path: { + channelId: channelId, + }, + }, + ); + } - /** - * Get a list item - * @returns any Success - * @throws ApiError - */ - public listItemRead({ channelId, listItemId }: { channelId: string; listItemId: string }): CancelablePromise<{ - listItem: ListItem; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/channels/{channelId}/items/{listItemId}", - path: { - channelId: channelId, - listItemId: listItemId, - }, - }); - } + /** + * Get a list item + * @returns any Success + * @throws ApiError + */ + public listItemRead({ + channelId, + listItemId, + }: { + channelId: string; + listItemId: string; + }): CancelablePromise<{ + listItem: ListItem; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/channels/{channelId}/items/{listItemId}", + path: { + channelId: channelId, + listItemId: listItemId, + }, + }, + ); + } - /** - * Update a list item - * @returns any Success - * @throws ApiError - */ - public listItemUpdate({ - channelId, - listItemId, - requestBody, - }: { - channelId: string; - listItemId: string; - requestBody: { - /** - * The message of the list item - */ - message?: string; - note?: { - /** - * The note of the list item - */ - content: string; - } | null; - }; - }): CancelablePromise<{ - listItem: ListItem; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/channels/{channelId}/items/{listItemId}", - path: { - channelId: channelId, - listItemId: listItemId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a list item + * @returns any Success + * @throws ApiError + */ + public listItemUpdate({ + channelId, + listItemId, + requestBody, + }: { + channelId: string; + listItemId: string; + requestBody: { + /** + * The message of the list item + */ + message?: string; + note?: { + /** + * The note of the list item + */ + content: string; + } | null; + }; + }): CancelablePromise<{ + listItem: ListItem; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/channels/{channelId}/items/{listItemId}", + path: { + channelId: channelId, + listItemId: listItemId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a list item - * @returns void - * @throws ApiError - */ - public listItemDelete({ channelId, listItemId }: { channelId: string; listItemId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/items/{listItemId}", - path: { - channelId: channelId, - listItemId: listItemId, - }, - }); - } + /** + * Delete a list item + * @returns void + * @throws ApiError + */ + public listItemDelete({ + channelId, + listItemId, + }: { + channelId: string; + listItemId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/items/{listItemId}", + path: { + channelId: channelId, + listItemId: listItemId, + }, + }, + ); + } - /** - * Complete a list item - * @returns void - * @throws ApiError - */ - public listItemCompleteCreate({ channelId, listItemId }: { channelId: string; listItemId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/channels/{channelId}/items/{listItemId}/complete", - path: { - channelId: channelId, - listItemId: listItemId, - }, - }); - } + /** + * Complete a list item + * @returns void + * @throws ApiError + */ + public listItemCompleteCreate({ + channelId, + listItemId, + }: { + channelId: string; + listItemId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "POST", + url: "/channels/{channelId}/items/{listItemId}/complete", + path: { + channelId: channelId, + listItemId: listItemId, + }, + }, + ); + } - /** - * Uncomplete a list item - * @returns void - * @throws ApiError - */ - public listItemCompleteDelete({ channelId, listItemId }: { channelId: string; listItemId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/items/{listItemId}/complete", - path: { - channelId: channelId, - listItemId: listItemId, - }, - }); - } + /** + * Uncomplete a list item + * @returns void + * @throws ApiError + */ + public listItemCompleteDelete({ + channelId, + listItemId, + }: { + channelId: string; + listItemId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/items/{listItemId}/complete", + path: { + channelId: channelId, + listItemId: listItemId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/MemberBansService.ts b/packages/api/lib/generated/router/services/MemberBansService.ts index 003d8c1b..f0d24702 100644 --- a/packages/api/lib/generated/router/services/MemberBansService.ts +++ b/packages/api/lib/generated/router/services/MemberBansService.ts @@ -4,116 +4,136 @@ /* eslint-disable */ import type { ServerMemberBan } from "../models/ServerMemberBan"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class MemberBansService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a server ban - * Also known as banning a server member - * @returns any Success - * @throws ApiError - */ - public serverMemberBanCreate({ - serverId, - userId, - requestBody, - }: { - serverId: string; - /** - * The ID of the user to ban from this server - */ - userId: string | "@me"; - requestBody?: { - /** - * The reason for the ban - */ - reason?: string; - }; - }): CancelablePromise<{ - serverMemberBan: ServerMemberBan; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/servers/{serverId}/bans/{userId}", - path: { - serverId: serverId, - userId: userId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a server ban + * Also known as banning a server member + * @returns any Success + * @throws ApiError + */ + public serverMemberBanCreate({ + serverId, + userId, + requestBody, + }: { + serverId: string; + /** + * The ID of the user to ban from this server + */ + userId: + | string + | "@me"; + requestBody?: { + /** + * The reason for the ban + */ + reason?: string; + }; + }): CancelablePromise<{ + serverMemberBan: ServerMemberBan; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/servers/{serverId}/bans/{userId}", + path: { + serverId: serverId, + userId: userId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get a server ban - * @returns any Success - * @throws ApiError - */ - public serverMemberBanRead({ - serverId, - userId, - }: { - serverId: string; - /** - * The ID of the user to get a server ban for - */ - userId: string | "@me"; - }): CancelablePromise<{ - serverMemberBan: ServerMemberBan; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/bans/{userId}", - path: { - serverId: serverId, - userId: userId, - }, - }); - } + /** + * Get a server ban + * @returns any Success + * @throws ApiError + */ + public serverMemberBanRead({ + serverId, + userId, + }: { + serverId: string; + /** + * The ID of the user to get a server ban for + */ + userId: + | string + | "@me"; + }): CancelablePromise<{ + serverMemberBan: ServerMemberBan; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/bans/{userId}", + path: { + serverId: serverId, + userId: userId, + }, + }, + ); + } - /** - * Delete a server ban - * Also known as unbanning a server member - * @returns void - * @throws ApiError - */ - public serverMemberBanDelete({ - serverId, - userId, - }: { - serverId: string; - /** - * The ID of the user to unban from this server - */ - userId: string | "@me"; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/servers/{serverId}/bans/{userId}", - path: { - serverId: serverId, - userId: userId, - }, - }); - } + /** + * Delete a server ban + * Also known as unbanning a server member + * @returns void + * @throws ApiError + */ + public serverMemberBanDelete({ + serverId, + userId, + }: { + serverId: string; + /** + * The ID of the user to unban from this server + */ + userId: + | string + | "@me"; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/servers/{serverId}/bans/{userId}", + path: { + serverId: serverId, + userId: userId, + }, + }, + ); + } - /** - * Get server bans - * @returns any Success - * @throws ApiError - */ - public serverMemberBanReadMany({ serverId }: { serverId: string }): CancelablePromise<{ - serverMemberBans: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/bans", - path: { - serverId: serverId, - }, - }); - } + /** + * Get server bans + * @returns any Success + * @throws ApiError + */ + public serverMemberBanReadMany({ + serverId, + }: { + serverId: string; + }): CancelablePromise<{ + serverMemberBans: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/bans", + path: { + serverId: serverId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/MembersService.ts b/packages/api/lib/generated/router/services/MembersService.ts index 32189b5a..e301d43c 100644 --- a/packages/api/lib/generated/router/services/MembersService.ts +++ b/packages/api/lib/generated/router/services/MembersService.ts @@ -5,138 +5,168 @@ import type { ServerMember } from "../models/ServerMember"; import type { ServerMemberSummary } from "../models/ServerMemberSummary"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class MembersService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Update a member's nickname - * @returns any Success - * @throws ApiError - */ - public memberNicknameUpdate({ - serverId, - userId, - requestBody, - }: { - serverId: string; - /** - * The ID of the user to update nickname for - */ - userId: string | "@me"; - requestBody: { - /** - * The nickname to assign to the member - */ - nickname: string; - }; - }): CancelablePromise<{ - /** - * The nickname that was assigned to the member - */ - nickname: string; - }> { - return this.httpRequest.request({ - method: "PUT", - url: "/servers/{serverId}/members/{userId}/nickname", - path: { - serverId: serverId, - userId: userId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a member's nickname + * @returns any Success + * @throws ApiError + */ + public memberNicknameUpdate({ + serverId, + userId, + requestBody, + }: { + serverId: string; + /** + * The ID of the user to update nickname for + */ + userId: + | string + | "@me"; + requestBody: { + /** + * The nickname to assign to the member + */ + nickname: string; + }; + }): CancelablePromise<{ + /** + * The nickname that was assigned to the member + */ + nickname: string; + }> { + return this.httpRequest.request( + { + method: "PUT", + url: "/servers/{serverId}/members/{userId}/nickname", + path: { + serverId: serverId, + userId: userId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a member's nickname - * @returns void - * @throws ApiError - */ - public memberNicknameDelete({ - serverId, - userId, - }: { - serverId: string; - /** - * The ID of the user to remove nickname from - */ - userId: string | "@me"; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/servers/{serverId}/members/{userId}/nickname", - path: { - serverId: serverId, - userId: userId, - }, - }); - } + /** + * Delete a member's nickname + * @returns void + * @throws ApiError + */ + public memberNicknameDelete({ + serverId, + userId, + }: { + serverId: string; + /** + * The ID of the user to remove nickname from + */ + userId: + | string + | "@me"; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/servers/{serverId}/members/{userId}/nickname", + path: { + serverId: serverId, + userId: userId, + }, + }, + ); + } - /** - * Get a server member - * @returns any Success - * @throws ApiError - */ - public serverMemberRead({ serverId, userId }: { serverId: string; userId: string | "@me" }): CancelablePromise<{ - member: ServerMember; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/members/{userId}", - path: { - serverId: serverId, - userId: userId, - }, - }); - } + /** + * Get a server member + * @returns any Success + * @throws ApiError + */ + public serverMemberRead({ + serverId, + userId, + }: { + serverId: string; + userId: + | string + | "@me"; + }): CancelablePromise<{ + member: ServerMember; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/members/{userId}", + path: { + serverId: serverId, + userId: userId, + }, + }, + ); + } - /** - * Kick a server member - * This route can be used to leave servers by passing in your own user ID or `@me` for `userId` - * @returns void - * @throws ApiError - */ - public serverMemberDelete({ - serverId, - userId, - }: { - /** - * The ID of the server to kick the user from - */ - serverId: string; - /** - * The ID of the user to kick. If the value provided here is your own user's ID, the request will attempt to make you leave the server - */ - userId: string | "@me"; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/servers/{serverId}/members/{userId}", - path: { - serverId: serverId, - userId: userId, - }, - }); - } + /** + * Kick a server member + * This route can be used to leave servers by passing in your own user ID or `@me` for `userId` + * @returns void + * @throws ApiError + */ + public serverMemberDelete({ + serverId, + userId, + }: { + /** + * The ID of the server to kick the user from + */ + serverId: string; + /** + * The ID of the user to kick. If the value provided here is your own user's ID, the request will attempt to make you leave the server + */ + userId: + | string + | "@me"; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/servers/{serverId}/members/{userId}", + path: { + serverId: serverId, + userId: userId, + }, + }, + ); + } - /** - * Get members of a server - * Results returned will be ordered ascending by the member's `joinedAt` - * @returns any Success - * @throws ApiError - */ - public serverMemberReadMany({ serverId }: { serverId: string }): CancelablePromise<{ - members: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/members", - path: { - serverId: serverId, - }, - }); - } + /** + * Get members of a server + * Results returned will be ordered ascending by the member's `joinedAt` + * @returns any Success + * @throws ApiError + */ + public serverMemberReadMany({ + serverId, + }: { + serverId: string; + }): CancelablePromise<{ + members: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/members", + path: { + serverId: serverId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/ReactionsService.ts b/packages/api/lib/generated/router/services/ReactionsService.ts index 3651b8f8..96af8afc 100644 --- a/packages/api/lib/generated/router/services/ReactionsService.ts +++ b/packages/api/lib/generated/router/services/ReactionsService.ts @@ -1,480 +1,600 @@ +import type { BaseHttpRequest } from "../core/BaseHttpRequest"; /* generated using openapi-typescript-codegen -- do no edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { CancelablePromise } from "../core/CancelablePromise"; -import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export class ReactionsService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create forum topic reaction - * @returns void - * @throws ApiError - */ - public forumTopicReactionCreate({ - channelId, - forumTopicId, - emoteId, - }: { - /** - * Channel ID where the forum topic exists - */ - channelId: string; - /** - * Forum Topic ID - */ - forumTopicId: number; - /** - * Emote ID to apply - */ - emoteId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/topics/{forumTopicId}/emotes/{emoteId}", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - emoteId: emoteId, - }, - }); - } + /** + * Create forum topic reaction + * @returns void + * @throws ApiError + */ + public forumTopicReactionCreate({ + channelId, + forumTopicId, + emoteId, + }: { + /** + * Channel ID where the forum topic exists + */ + channelId: string; + /** + * Forum Topic ID + */ + forumTopicId: number; + /** + * Emote ID to apply + */ + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/topics/{forumTopicId}/emotes/{emoteId}", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Delete forum topic reaction - * @returns void - * @throws ApiError - */ - public forumTopicReactionDelete({ - channelId, - forumTopicId, - emoteId, - }: { - /** - * Channel ID where the forum topic exists - */ - channelId: string; - /** - * Forum Topic ID - */ - forumTopicId: number; - /** - * Emote ID to remove - */ - emoteId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/topics/{forumTopicId}/emotes/{emoteId}", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - emoteId: emoteId, - }, - }); - } + /** + * Delete forum topic reaction + * @returns void + * @throws ApiError + */ + public forumTopicReactionDelete({ + channelId, + forumTopicId, + emoteId, + }: { + /** + * Channel ID where the forum topic exists + */ + channelId: string; + /** + * Forum Topic ID + */ + forumTopicId: number; + /** + * Emote ID to remove + */ + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/topics/{forumTopicId}/emotes/{emoteId}", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Create forum topic comment reaction - * @returns void - * @throws ApiError - */ - public forumTopicCommentReactionCreate({ - channelId, - forumTopicId, - forumTopicCommentId, - emoteId, - }: { - /** - * Channel ID where the forum topic exists - */ - channelId: string; - forumTopicId: number; - forumTopicCommentId: number; - emoteId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/topics/{forumTopicId}/comments/{forumTopicCommentId}/emotes/{emoteId}", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - forumTopicCommentId: forumTopicCommentId, - emoteId: emoteId, - }, - }); - } + /** + * Create forum topic comment reaction + * @returns void + * @throws ApiError + */ + public forumTopicCommentReactionCreate({ + channelId, + forumTopicId, + forumTopicCommentId, + emoteId, + }: { + /** + * Channel ID where the forum topic exists + */ + channelId: string; + forumTopicId: number; + forumTopicCommentId: number; + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/topics/{forumTopicId}/comments/{forumTopicCommentId}/emotes/{emoteId}", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + forumTopicCommentId: forumTopicCommentId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Delete forum topic comment reaction - * @returns void - * @throws ApiError - */ - public forumTopicCommentReactionDelete({ - channelId, - forumTopicId, - forumTopicCommentId, - emoteId, - }: { - /** - * Channel ID where the forum topic exists - */ - channelId: string; - forumTopicId: number; - forumTopicCommentId: number; - emoteId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/topics/{forumTopicId}/comments/{forumTopicCommentId}/emotes/{emoteId}", - path: { - channelId: channelId, - forumTopicId: forumTopicId, - forumTopicCommentId: forumTopicCommentId, - emoteId: emoteId, - }, - }); - } + /** + * Delete forum topic comment reaction + * @returns void + * @throws ApiError + */ + public forumTopicCommentReactionDelete({ + channelId, + forumTopicId, + forumTopicCommentId, + emoteId, + }: { + /** + * Channel ID where the forum topic exists + */ + channelId: string; + forumTopicId: number; + forumTopicCommentId: number; + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/topics/{forumTopicId}/comments/{forumTopicCommentId}/emotes/{emoteId}", + path: { + channelId: channelId, + forumTopicId: forumTopicId, + forumTopicCommentId: forumTopicCommentId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Create calendar event reaction - * @returns void - * @throws ApiError - */ - public calendarEventReactionCreate({ channelId, calendarEventId, emoteId }: { channelId: string; calendarEventId: number; emoteId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/events/{calendarEventId}/emotes/{emoteId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - emoteId: emoteId, - }, - }); - } + /** + * Create calendar event reaction + * @returns void + * @throws ApiError + */ + public calendarEventReactionCreate({ + channelId, + calendarEventId, + emoteId, + }: { + channelId: string; + calendarEventId: number; + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/events/{calendarEventId}/emotes/{emoteId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Delete calendar event reaction - * @returns void - * @throws ApiError - */ - public calendarEventReactionDelete({ channelId, calendarEventId, emoteId }: { channelId: string; calendarEventId: number; emoteId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/events/{calendarEventId}/emotes/{emoteId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - emoteId: emoteId, - }, - }); - } + /** + * Delete calendar event reaction + * @returns void + * @throws ApiError + */ + public calendarEventReactionDelete({ + channelId, + calendarEventId, + emoteId, + }: { + channelId: string; + calendarEventId: number; + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/events/{calendarEventId}/emotes/{emoteId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Create calendar event comment reaction - * @returns void - * @throws ApiError - */ - public calendarEventCommentReactionCreate({ - channelId, - calendarEventId, - calendarEventCommentId, - emoteId, - }: { - channelId: string; - calendarEventId: number; - calendarEventCommentId: number; - emoteId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/events/{calendarEventId}/comments/{calendarEventCommentId}/emotes/{emoteId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - calendarEventCommentId: calendarEventCommentId, - emoteId: emoteId, - }, - }); - } + /** + * Create calendar event comment reaction + * @returns void + * @throws ApiError + */ + public calendarEventCommentReactionCreate({ + channelId, + calendarEventId, + calendarEventCommentId, + emoteId, + }: { + channelId: string; + calendarEventId: number; + calendarEventCommentId: number; + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/events/{calendarEventId}/comments/{calendarEventCommentId}/emotes/{emoteId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + calendarEventCommentId: calendarEventCommentId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Delete calendar event comment reaction - * @returns void - * @throws ApiError - */ - public calendarEventCommentReactionDelete({ - channelId, - calendarEventId, - calendarEventCommentId, - emoteId, - }: { - channelId: string; - calendarEventId: number; - calendarEventCommentId: number; - emoteId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/events/{calendarEventId}/comments/{calendarEventCommentId}/emotes/{emoteId}", - path: { - channelId: channelId, - calendarEventId: calendarEventId, - calendarEventCommentId: calendarEventCommentId, - emoteId: emoteId, - }, - }); - } + /** + * Delete calendar event comment reaction + * @returns void + * @throws ApiError + */ + public calendarEventCommentReactionDelete({ + channelId, + calendarEventId, + calendarEventCommentId, + emoteId, + }: { + channelId: string; + calendarEventId: number; + calendarEventCommentId: number; + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/events/{calendarEventId}/comments/{calendarEventCommentId}/emotes/{emoteId}", + path: { + channelId: channelId, + calendarEventId: calendarEventId, + calendarEventCommentId: calendarEventCommentId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Create doc reaction - * @returns void - * @throws ApiError - */ - public docReactionCreate({ channelId, docId, emoteId }: { channelId: string; docId: number; emoteId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/docs/{docId}/emotes/{emoteId}", - path: { - channelId: channelId, - docId: docId, - emoteId: emoteId, - }, - }); - } + /** + * Create doc reaction + * @returns void + * @throws ApiError + */ + public docReactionCreate({ + channelId, + docId, + emoteId, + }: { + channelId: string; + docId: number; + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/docs/{docId}/emotes/{emoteId}", + path: { + channelId: channelId, + docId: docId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Delete doc reaction - * @returns void - * @throws ApiError - */ - public docReactionDelete({ channelId, docId, emoteId }: { channelId: string; docId: number; emoteId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/docs/{docId}/emotes/{emoteId}", - path: { - channelId: channelId, - docId: docId, - emoteId: emoteId, - }, - }); - } + /** + * Delete doc reaction + * @returns void + * @throws ApiError + */ + public docReactionDelete({ + channelId, + docId, + emoteId, + }: { + channelId: string; + docId: number; + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/docs/{docId}/emotes/{emoteId}", + path: { + channelId: channelId, + docId: docId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Create doc comment reaction - * @returns void - * @throws ApiError - */ - public docCommentReactionCreate({ channelId, docId, docCommentId, emoteId }: { channelId: string; docId: number; docCommentId: number; emoteId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/docs/{docId}/comments/{docCommentId}/emotes/{emoteId}", - path: { - channelId: channelId, - docId: docId, - docCommentId: docCommentId, - emoteId: emoteId, - }, - }); - } + /** + * Create doc comment reaction + * @returns void + * @throws ApiError + */ + public docCommentReactionCreate({ + channelId, + docId, + docCommentId, + emoteId, + }: { + channelId: string; + docId: number; + docCommentId: number; + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/docs/{docId}/comments/{docCommentId}/emotes/{emoteId}", + path: { + channelId: channelId, + docId: docId, + docCommentId: docCommentId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Delete doc comment reaction - * @returns void - * @throws ApiError - */ - public docCommentReactionDelete({ channelId, docId, docCommentId, emoteId }: { channelId: string; docId: number; docCommentId: number; emoteId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/docs/{docId}/comments/{docCommentId}/emotes/{emoteId}", - path: { - channelId: channelId, - docId: docId, - docCommentId: docCommentId, - emoteId: emoteId, - }, - }); - } + /** + * Delete doc comment reaction + * @returns void + * @throws ApiError + */ + public docCommentReactionDelete({ + channelId, + docId, + docCommentId, + emoteId, + }: { + channelId: string; + docId: number; + docCommentId: number; + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/docs/{docId}/comments/{docCommentId}/emotes/{emoteId}", + path: { + channelId: channelId, + docId: docId, + docCommentId: docCommentId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Create announcement reaction - * @returns void - * @throws ApiError - */ - public announcementReactionCreate({ - channelId, - announcementId, - emoteId, - }: { - channelId: string; - announcementId: string; - /** - * Emote ID to apply - */ - emoteId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/announcements/{announcementId}/emotes/{emoteId}", - path: { - channelId: channelId, - announcementId: announcementId, - emoteId: emoteId, - }, - }); - } + /** + * Create announcement reaction + * @returns void + * @throws ApiError + */ + public announcementReactionCreate({ + channelId, + announcementId, + emoteId, + }: { + channelId: string; + announcementId: string; + /** + * Emote ID to apply + */ + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/announcements/{announcementId}/emotes/{emoteId}", + path: { + channelId: channelId, + announcementId: announcementId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Delete announcement reaction - * @returns void - * @throws ApiError - */ - public announcementReactionDelete({ - channelId, - announcementId, - emoteId, - }: { - channelId: string; - announcementId: string; - /** - * Emote ID to apply - */ - emoteId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/announcements/{announcementId}/emotes/{emoteId}", - path: { - channelId: channelId, - announcementId: announcementId, - emoteId: emoteId, - }, - }); - } + /** + * Delete announcement reaction + * @returns void + * @throws ApiError + */ + public announcementReactionDelete({ + channelId, + announcementId, + emoteId, + }: { + channelId: string; + announcementId: string; + /** + * Emote ID to apply + */ + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/announcements/{announcementId}/emotes/{emoteId}", + path: { + channelId: channelId, + announcementId: announcementId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Create an announcement comment reaction - * @returns void - * @throws ApiError - */ - public announcementCommentReactionCreate({ - channelId, - announcementId, - announcementCommentId, - emoteId, - }: { - /** - * Channel ID where the announcement comment exists - */ - channelId: string; - announcementId: string; - announcementCommentId: number; - /** - * Emote ID to apply - */ - emoteId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/announcements/{announcementId}/comments/{announcementCommentId}/emotes/{emoteId}", - path: { - channelId: channelId, - announcementId: announcementId, - announcementCommentId: announcementCommentId, - emoteId: emoteId, - }, - }); - } + /** + * Create an announcement comment reaction + * @returns void + * @throws ApiError + */ + public announcementCommentReactionCreate({ + channelId, + announcementId, + announcementCommentId, + emoteId, + }: { + /** + * Channel ID where the announcement comment exists + */ + channelId: string; + announcementId: string; + announcementCommentId: number; + /** + * Emote ID to apply + */ + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/announcements/{announcementId}/comments/{announcementCommentId}/emotes/{emoteId}", + path: { + channelId: channelId, + announcementId: announcementId, + announcementCommentId: announcementCommentId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Delete an announcement comment reaction - * @returns void - * @throws ApiError - */ - public announcementCommentReactionDelete({ - channelId, - announcementId, - announcementCommentId, - emoteId, - }: { - /** - * Channel ID where the announcement comment exists - */ - channelId: string; - announcementId: string; - announcementCommentId: number; - /** - * Emote ID to apply - */ - emoteId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/announcements/{announcementId}/comments/{announcementCommentId}/emotes/{emoteId}", - path: { - channelId: channelId, - announcementId: announcementId, - announcementCommentId: announcementCommentId, - emoteId: emoteId, - }, - }); - } + /** + * Delete an announcement comment reaction + * @returns void + * @throws ApiError + */ + public announcementCommentReactionDelete({ + channelId, + announcementId, + announcementCommentId, + emoteId, + }: { + /** + * Channel ID where the announcement comment exists + */ + channelId: string; + announcementId: string; + announcementCommentId: number; + /** + * Emote ID to apply + */ + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/announcements/{announcementId}/comments/{announcementCommentId}/emotes/{emoteId}", + path: { + channelId: channelId, + announcementId: announcementId, + announcementCommentId: announcementCommentId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Create a message reaction - * @returns void - * @throws ApiError - */ - public channelMessageReactionCreate({ channelId, messageId, emoteId }: { channelId: string; messageId: string; emoteId: number }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/channels/{channelId}/messages/{messageId}/emotes/{emoteId}", - path: { - channelId: channelId, - messageId: messageId, - emoteId: emoteId, - }, - }); - } + /** + * Create a message reaction + * @returns void + * @throws ApiError + */ + public channelMessageReactionCreate({ + channelId, + messageId, + emoteId, + }: { + channelId: string; + messageId: string; + emoteId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/channels/{channelId}/messages/{messageId}/emotes/{emoteId}", + path: { + channelId: channelId, + messageId: messageId, + emoteId: emoteId, + }, + }, + ); + } - /** - * Delete a message reaction - * @returns void - * @throws ApiError - */ - public channelMessageReactionDelete({ channelId, messageId, emoteId, userId }: { channelId: string; messageId: string; emoteId: number; userId?: string | "@me" }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/messages/{messageId}/emotes/{emoteId}", - path: { - channelId: channelId, - messageId: messageId, - emoteId: emoteId, - }, - query: { - userId: userId, - }, - }); - } + /** + * Delete a message reaction + * @returns void + * @throws ApiError + */ + public channelMessageReactionDelete({ + channelId, + messageId, + emoteId, + userId, + }: { + channelId: string; + messageId: string; + emoteId: number; + userId?: + | string + | "@me"; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/messages/{messageId}/emotes/{emoteId}", + path: { + channelId: channelId, + messageId: messageId, + emoteId: emoteId, + }, + query: { + userId: userId, + }, + }, + ); + } - /** - * Bulk delete a message's reactions - * @returns void - * @throws ApiError - */ - public channelMessageReactionDeleteMany({ channelId, messageId, emoteId }: { channelId: string; messageId: string; emoteId?: number }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/channels/{channelId}/messages/{messageId}/emotes", - path: { - channelId: channelId, - messageId: messageId, - }, - query: { - emoteId: emoteId, - }, - }); - } + /** + * Bulk delete a message's reactions + * @returns void + * @throws ApiError + */ + public channelMessageReactionDeleteMany({ + channelId, + messageId, + emoteId, + }: { + channelId: string; + messageId: string; + emoteId?: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/channels/{channelId}/messages/{messageId}/emotes", + path: { + channelId: channelId, + messageId: messageId, + }, + query: { + emoteId: emoteId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/RoleMembershipService.ts b/packages/api/lib/generated/router/services/RoleMembershipService.ts index 3be02a9a..4c7728ce 100644 --- a/packages/api/lib/generated/router/services/RoleMembershipService.ts +++ b/packages/api/lib/generated/router/services/RoleMembershipService.ts @@ -1,103 +1,117 @@ +import type { BaseHttpRequest } from "../core/BaseHttpRequest"; /* generated using openapi-typescript-codegen -- do no edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { CancelablePromise } from "../core/CancelablePromise"; -import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export class RoleMembershipService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Assign role to member - * @returns void - * @throws ApiError - */ - public roleMembershipCreate({ - serverId, - userId, - roleId, - }: { - serverId: string; - /** - * The ID of the member that the role should be assigned to - */ - userId: string | "@me"; - /** - * The role ID to apply to the user - */ - roleId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/servers/{serverId}/members/{userId}/roles/{roleId}", - path: { - serverId: serverId, - userId: userId, - roleId: roleId, - }, - }); - } + /** + * Assign role to member + * @returns void + * @throws ApiError + */ + public roleMembershipCreate({ + serverId, + userId, + roleId, + }: { + serverId: string; + /** + * The ID of the member that the role should be assigned to + */ + userId: + | string + | "@me"; + /** + * The role ID to apply to the user + */ + roleId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/servers/{serverId}/members/{userId}/roles/{roleId}", + path: { + serverId: serverId, + userId: userId, + roleId: roleId, + }, + }, + ); + } - /** - * Remove role from member - * @returns void - * @throws ApiError - */ - public roleMembershipDelete({ - serverId, - userId, - roleId, - }: { - serverId: string; - /** - * The ID of the member that the role should be removed from - */ - userId: string | "@me"; - /** - * The role ID to remove from the user - */ - roleId: number; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/servers/{serverId}/members/{userId}/roles/{roleId}", - path: { - serverId: serverId, - userId: userId, - roleId: roleId, - }, - }); - } + /** + * Remove role from member + * @returns void + * @throws ApiError + */ + public roleMembershipDelete({ + serverId, + userId, + roleId, + }: { + serverId: string; + /** + * The ID of the member that the role should be removed from + */ + userId: + | string + | "@me"; + /** + * The role ID to remove from the user + */ + roleId: number; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/servers/{serverId}/members/{userId}/roles/{roleId}", + path: { + serverId: serverId, + userId: userId, + roleId: roleId, + }, + }, + ); + } - /** - * Get member roles - * Get a list of the roles assigned to a member - * @returns any Success - * @throws ApiError - */ - public roleMembershipReadMany({ - serverId, - userId, - }: { - serverId: string; - /** - * The ID of the member to obtain roles from - */ - userId: string | "@me"; - }): CancelablePromise<{ - /** - * The IDs of the roles that the member currently has - */ - roleIds: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/members/{userId}/roles", - path: { - serverId: serverId, - userId: userId, - }, - }); - } + /** + * Get member roles + * Get a list of the roles assigned to a member + * @returns any Success + * @throws ApiError + */ + public roleMembershipReadMany({ + serverId, + userId, + }: { + serverId: string; + /** + * The ID of the member to obtain roles from + */ + userId: + | string + | "@me"; + }): CancelablePromise<{ + /** + * The IDs of the roles that the member currently has + */ + roleIds: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/members/{userId}/roles", + path: { + serverId: serverId, + userId: userId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/RolesService.ts b/packages/api/lib/generated/router/services/RolesService.ts index a15e5cb1..c6b31419 100644 --- a/packages/api/lib/generated/router/services/RolesService.ts +++ b/packages/api/lib/generated/router/services/RolesService.ts @@ -4,319 +4,356 @@ /* eslint-disable */ import type { Role } from "../models/Role"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class RolesService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Get a role - * @returns any Success - * @throws ApiError - */ - public roleRead({ serverId, roleId }: { serverId: string; roleId: number }): CancelablePromise<{ - role: Role; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/roles/{roleId}", - path: { - serverId: serverId, - roleId: roleId, - }, - }); - } + /** + * Get a role + * @returns any Success + * @throws ApiError + */ + public roleRead({ + serverId, + roleId, + }: { + serverId: string; + roleId: number; + }): CancelablePromise<{ + role: Role; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/roles/{roleId}", + path: { + serverId: serverId, + roleId: roleId, + }, + }, + ); + } - /** - * Delete a role - * @returns any Success - * @throws ApiError - */ - public roleDelete({ serverId, roleId }: { serverId: string; roleId: number }): CancelablePromise<{ - role: Role; - }> { - return this.httpRequest.request({ - method: "DELETE", - url: "/servers/{serverId}/roles/{roleId}", - path: { - serverId: serverId, - roleId: roleId, - }, - }); - } + /** + * Delete a role + * @returns any Success + * @throws ApiError + */ + public roleDelete({ + serverId, + roleId, + }: { + serverId: string; + roleId: number; + }): CancelablePromise<{ + role: Role; + }> { + return this.httpRequest.request( + { + method: "DELETE", + url: "/servers/{serverId}/roles/{roleId}", + path: { + serverId: serverId, + roleId: roleId, + }, + }, + ); + } - /** - * Update a role - * @returns any Success - * @throws ApiError - */ - public roleUpdate({ - serverId, - roleId, - requestBody, - }: { - serverId: string; - roleId: number; - requestBody: { - /** - * The role's name - */ - name?: string; - /** - * If set, the role will be displayed separately in the channel member list - */ - isDisplayedSeparately?: boolean; - /** - * If set, this roll will be self assigned - */ - isSelfAssignable?: boolean; - /** - * If set, this role can be mentioned - */ - isMentionable?: boolean; - /** - * Permissions must be a collection of valid permissions as defined in the [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) section - */ - permissions?: Array; - /** - * An array of integer values corresponding to the decimal RGB representation for a color. The first color is solid, and a second color indicates a gradient - */ - colors?: Array; - }; - }): CancelablePromise<{ - role: Role; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/servers/{serverId}/roles/{roleId}", - path: { - serverId: serverId, - roleId: roleId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a role + * @returns any Success + * @throws ApiError + */ + public roleUpdate({ + serverId, + roleId, + requestBody, + }: { + serverId: string; + roleId: number; + requestBody: { + /** + * The role's name + */ + name?: string; + /** + * If set, the role will be displayed separately in the channel member list + */ + isDisplayedSeparately?: boolean; + /** + * If set, this roll will be self assigned + */ + isSelfAssignable?: boolean; + /** + * If set, this role can be mentioned + */ + isMentionable?: boolean; + /** + * Permissions must be a collection of valid permissions as defined in the [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) section + */ + permissions?: Array; + /** + * An array of integer values corresponding to the decimal RGB representation for a color. The first color is solid, and a second color indicates a gradient + */ + colors?: Array; + }; + }): CancelablePromise<{ + role: Role; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/servers/{serverId}/roles/{roleId}", + path: { + serverId: serverId, + roleId: roleId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get roles - * @returns any Success - * @throws ApiError - */ - public roleReadMany({ serverId }: { serverId: string }): CancelablePromise<{ - roles: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/roles", - path: { - serverId: serverId, - }, - }); - } + /** + * Get roles + * @returns any Success + * @throws ApiError + */ + public roleReadMany({ + serverId, + }: { + serverId: string; + }): CancelablePromise<{ + roles: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/roles", + path: { + serverId: serverId, + }, + }, + ); + } - /** - * Create a role - * @returns any Success - * @throws ApiError - */ - public roleCreate({ - serverId, - requestBody, - }: { - serverId: string; - requestBody: { - /** - * The role's name - */ - name: string; - /** - * If set, the role will be displayed separately in the channel member list - */ - isDisplayedSeparately?: boolean; - /** - * If set, this roll will be self assigned - */ - isSelfAssignable?: boolean; - /** - * If set, this role can be mentioned - */ - isMentionable?: boolean; - /** - * Permissions must be a collection of valid permissions as defined in the [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) section - */ - permissions: Array; - /** - * An array of integer values corresponding to the decimal RGB representation for a color. The first color is solid, and a second color indicates a gradient - */ - colors?: Array; - }; - }): CancelablePromise<{ - role: Role; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/servers/{serverId}/roles", - path: { - serverId: serverId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a role + * @returns any Success + * @throws ApiError + */ + public roleCreate({ + serverId, + requestBody, + }: { + serverId: string; + requestBody: { + /** + * The role's name + */ + name: string; + /** + * If set, the role will be displayed separately in the channel member list + */ + isDisplayedSeparately?: boolean; + /** + * If set, this roll will be self assigned + */ + isSelfAssignable?: boolean; + /** + * If set, this role can be mentioned + */ + isMentionable?: boolean; + /** + * Permissions must be a collection of valid permissions as defined in the [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) section + */ + permissions: Array; + /** + * An array of integer values corresponding to the decimal RGB representation for a color. The first color is solid, and a second color indicates a gradient + */ + colors?: Array; + }; + }): CancelablePromise<{ + role: Role; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/servers/{serverId}/roles", + path: { + serverId: serverId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Update a role permission - * @returns any Success - * @throws ApiError - */ - public rolePermissionUpdate({ - serverId, - roleId, - requestBody, - }: { - serverId: string; - roleId: number; - requestBody: { - /** - * A JSON object of [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) with `true` or `false` values. - */ - permissions: Record; - }; - }): CancelablePromise<{ - role: Role; - }> { - return this.httpRequest.request({ - method: "PATCH", - url: "/servers/{serverId}/roles/{roleId}/permissions", - path: { - serverId: serverId, - roleId: roleId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a role permission + * @returns any Success + * @throws ApiError + */ + public rolePermissionUpdate({ + serverId, + roleId, + requestBody, + }: { + serverId: string; + roleId: number; + requestBody: { + /** + * A JSON object of [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) with `true` or `false` values. + */ + permissions: Record< + string, + any + >; + }; + }): CancelablePromise<{ + role: Role; + }> { + return this.httpRequest.request( + { + method: "PATCH", + url: "/servers/{serverId}/roles/{roleId}/permissions", + path: { + serverId: serverId, + roleId: roleId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Read a server member's permissions - * If the user has *all* of the permissions passed, the HTTP status code will be 200; if user is missing one or more permissions passed, the HTTP status code will be [418](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418) with a `meta` property containing `missingPermissions` of the permissions the user does not have (this is a 418 to differentiate from a 403 if the _bot_ did not have permissions to perform the request, not the _user_). Tip: Use the `HEAD` HTTP method for this route if you only care about if the user has permissions and not the response body containing what's missing. - * @returns any Success - * @throws ApiError - */ - public serverMemberPermissionsRead({ - serverId, - userId, - ids, - }: { - serverId: string; - userId: string | "@me"; - /** - * A queryString array of `ids[]` representing [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) - */ - ids?: Array< - | "CanCreateTopics" - | "CanCreateTopicReplies" - | "CanDeleteTopics" - | "CanStickyTopics" - | "CanLockTopics" - | "CanManageEmotes" - | "CanViewFormResponses" - | "CanUpdateListItems" - | "CanManageServerXp" - | "CanCreateThreads" - | "CanCreateThreadMessages" - | "CanManageThreads" - | "CanCreateAnnouncements" - | "CanUpdateServer" - | "CanManageRoles" - | "CanInviteMembers" - | "CanKickMembers" - | "CanManageGroups" - | "CanManageChannels" - | "CanManageWebhooks" - | "CanMentionEveryone" - | "CanModerateChannels" - | "CanBypassSlowMode" - | "CanReadApplications" - | "CanApproveApplications" - | "CanEditApplicationForm" - | "CanIndicateLfmInterest" - | "CanModifyLfmStatus" - | "CanReadAnnouncements" - | "CanManageAnnouncements" - | "CanReadChats" - | "CanCreateChats" - | "CanUploadChatMedia" - | "CanCreatePrivateMessages" - | "CanManageChats" - | "CanReadEvents" - | "CanCreateEvents" - | "CanEditEvents" - | "CanDeleteEvents" - | "CanEditEventRsvps" - | "CanReadForums" - | "CanReadDocs" - | "CanCreateDocs" - | "CanEditDocs" - | "CanDeleteDocs" - | "CanReadMedia" - | "CanAddMedia" - | "CanEditMedia" - | "CanDeleteMedia" - | "CanListenVoice" - | "CanAddVoice" - | "CanManageVoiceGroups" - | "CanAssignVoiceGroup" - | "CanBroadcastVoice" - | "CanDirectVoice" - | "CanPrioritizeVoice" - | "CanUseVoiceActivity" - | "CanMuteMembers" - | "CanDeafenMembers" - | "CanSendVoiceMessages" - | "CanCreateScrims" - | "CanManageTournaments" - | "CanRegisterForTournaments" - | "CanChangeNickname" - | "CanManageNicknames" - | "CanViewPollResponses" - | "CanReadListItems" - | "CanCreateListItems" - | "CanDeleteListItems" - | "CanCompleteListItems" - | "CanReorderListItems" - | "CanViewBracket" - | "CanReportScores" - | "CanReadSchedules" - | "CanCreateSchedule" - | "CanDeleteSchedule" - | "CanManageBots" - | "CanReadStreams" - | "CanJoinStreamVoice" - | "CanCreateStreams" - | "CanSendStreamMessages" - | "CanAddStreamVoice" - | "CanUseVoiceActivityInStream" - | "CanReceiveAllSocketEvents" - >; - }): CancelablePromise<{ - /** - * A list of [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) the User has in the success case - */ - permissions: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/members/{userId}/permissions", - path: { - serverId: serverId, - userId: userId, - }, - query: { - ids: ids, - }, - }); - } + /** + * Read a server member's permissions + * If the user has *all* of the permissions passed, the HTTP status code will be 200; if user is missing one or more permissions passed, the HTTP status code will be [418](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418) with a `meta` property containing `missingPermissions` of the permissions the user does not have (this is a 418 to differentiate from a 403 if the _bot_ did not have permissions to perform the request, not the _user_). Tip: Use the `HEAD` HTTP method for this route if you only care about if the user has permissions and not the response body containing what's missing. + * @returns any Success + * @throws ApiError + */ + public serverMemberPermissionsRead({ + serverId, + userId, + ids, + }: { + serverId: string; + userId: + | string + | "@me"; + /** + * A queryString array of `ids[]` representing [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) + */ + ids?: Array< + | "CanCreateTopics" + | "CanCreateTopicReplies" + | "CanDeleteTopics" + | "CanStickyTopics" + | "CanLockTopics" + | "CanManageEmotes" + | "CanViewFormResponses" + | "CanUpdateListItems" + | "CanManageServerXp" + | "CanCreateThreads" + | "CanCreateThreadMessages" + | "CanManageThreads" + | "CanCreateAnnouncements" + | "CanUpdateServer" + | "CanManageRoles" + | "CanInviteMembers" + | "CanKickMembers" + | "CanManageGroups" + | "CanManageChannels" + | "CanManageWebhooks" + | "CanMentionEveryone" + | "CanModerateChannels" + | "CanBypassSlowMode" + | "CanReadApplications" + | "CanApproveApplications" + | "CanEditApplicationForm" + | "CanIndicateLfmInterest" + | "CanModifyLfmStatus" + | "CanReadAnnouncements" + | "CanManageAnnouncements" + | "CanReadChats" + | "CanCreateChats" + | "CanUploadChatMedia" + | "CanCreatePrivateMessages" + | "CanManageChats" + | "CanReadEvents" + | "CanCreateEvents" + | "CanEditEvents" + | "CanDeleteEvents" + | "CanEditEventRsvps" + | "CanReadForums" + | "CanReadDocs" + | "CanCreateDocs" + | "CanEditDocs" + | "CanDeleteDocs" + | "CanReadMedia" + | "CanAddMedia" + | "CanEditMedia" + | "CanDeleteMedia" + | "CanListenVoice" + | "CanAddVoice" + | "CanManageVoiceGroups" + | "CanAssignVoiceGroup" + | "CanBroadcastVoice" + | "CanDirectVoice" + | "CanPrioritizeVoice" + | "CanUseVoiceActivity" + | "CanMuteMembers" + | "CanDeafenMembers" + | "CanSendVoiceMessages" + | "CanCreateScrims" + | "CanManageTournaments" + | "CanRegisterForTournaments" + | "CanChangeNickname" + | "CanManageNicknames" + | "CanViewPollResponses" + | "CanReadListItems" + | "CanCreateListItems" + | "CanDeleteListItems" + | "CanCompleteListItems" + | "CanReorderListItems" + | "CanViewBracket" + | "CanReportScores" + | "CanReadSchedules" + | "CanCreateSchedule" + | "CanDeleteSchedule" + | "CanManageBots" + | "CanReadStreams" + | "CanJoinStreamVoice" + | "CanCreateStreams" + | "CanSendStreamMessages" + | "CanAddStreamVoice" + | "CanUseVoiceActivityInStream" + | "CanReceiveAllSocketEvents" + >; + }): CancelablePromise<{ + /** + * A list of [Enums/Permissions](https://www.guilded.gg/docs/api/Permissions) the User has in the success case + */ + permissions: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/members/{userId}/permissions", + path: { + serverId: serverId, + userId: userId, + }, + query: { + ids: ids, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/ServerSubscriptionService.ts b/packages/api/lib/generated/router/services/ServerSubscriptionService.ts index 909084f7..034b200e 100644 --- a/packages/api/lib/generated/router/services/ServerSubscriptionService.ts +++ b/packages/api/lib/generated/router/services/ServerSubscriptionService.ts @@ -4,44 +4,63 @@ /* eslint-disable */ import type { ServerSubscriptionTier } from "../models/ServerSubscriptionTier"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class ServerSubscriptionService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Get a server subscription tier - * @returns any Success - * @throws ApiError - */ - public serverSubscriptionTierRead({ serverId, serverSubscriptionTierType }: { serverId: string; serverSubscriptionTierType: "Gold" | "Silver" | "Copper" }): CancelablePromise<{ - serverSubscriptionTier: ServerSubscriptionTier; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/subscriptions/tiers/{serverSubscriptionTierType}", - path: { - serverId: serverId, - serverSubscriptionTierType: serverSubscriptionTierType, - }, - }); - } + /** + * Get a server subscription tier + * @returns any Success + * @throws ApiError + */ + public serverSubscriptionTierRead({ + serverId, + serverSubscriptionTierType, + }: { + serverId: string; + serverSubscriptionTierType: + | "Gold" + | "Silver" + | "Copper"; + }): CancelablePromise<{ + serverSubscriptionTier: ServerSubscriptionTier; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/subscriptions/tiers/{serverSubscriptionTierType}", + path: { + serverId: serverId, + serverSubscriptionTierType: serverSubscriptionTierType, + }, + }, + ); + } - /** - * Get server subscription tiers - * @returns any Success - * @throws ApiError - */ - public serverSubscriptionTierReadMany({ serverId }: { serverId: string }): CancelablePromise<{ - serverSubscriptionTiers: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/subscriptions/tiers", - path: { - serverId: serverId, - }, - }); - } + /** + * Get server subscription tiers + * @returns any Success + * @throws ApiError + */ + public serverSubscriptionTierReadMany({ + serverId, + }: { + serverId: string; + }): CancelablePromise<{ + serverSubscriptionTiers: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/subscriptions/tiers", + path: { + serverId: serverId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/ServerXpService.ts b/packages/api/lib/generated/router/services/ServerXpService.ts index 5cb1a9e9..6a7c0d14 100644 --- a/packages/api/lib/generated/router/services/ServerXpService.ts +++ b/packages/api/lib/generated/router/services/ServerXpService.ts @@ -1,193 +1,221 @@ +import type { BaseHttpRequest } from "../core/BaseHttpRequest"; /* generated using openapi-typescript-codegen -- do no edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { CancelablePromise } from "../core/CancelablePromise"; -import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export class ServerXpService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Award XP to a member - * @returns any Success - * @throws ApiError - */ - public serverXpForUserCreate({ - serverId, - userId, - requestBody, - }: { - serverId: string; - /** - * Member ID to award XP to - */ - userId: string | "@me"; - requestBody: { - /** - * The amount of XP to award - */ - amount: number; - }; - }): CancelablePromise<{ - /** - * The total XP after this operation - */ - total: number; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/servers/{serverId}/members/{userId}/xp", - path: { - serverId: serverId, - userId: userId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Award XP to a member + * @returns any Success + * @throws ApiError + */ + public serverXpForUserCreate({ + serverId, + userId, + requestBody, + }: { + serverId: string; + /** + * Member ID to award XP to + */ + userId: + | string + | "@me"; + requestBody: { + /** + * The amount of XP to award + */ + amount: number; + }; + }): CancelablePromise<{ + /** + * The total XP after this operation + */ + total: number; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/servers/{serverId}/members/{userId}/xp", + path: { + serverId: serverId, + userId: userId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Set a member's XP - * @returns any Success - * @throws ApiError - */ - public serverXpForUserUpdate({ - serverId, - userId, - requestBody, - }: { - serverId: string; - /** - * Member ID to set XP to - */ - userId: string | "@me"; - requestBody: { - /** - * The total XP to set on the user - */ - total: number; - }; - }): CancelablePromise<{ - /** - * The total XP after this operation - */ - total: number; - }> { - return this.httpRequest.request({ - method: "PUT", - url: "/servers/{serverId}/members/{userId}/xp", - path: { - serverId: serverId, - userId: userId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Set a member's XP + * @returns any Success + * @throws ApiError + */ + public serverXpForUserUpdate({ + serverId, + userId, + requestBody, + }: { + serverId: string; + /** + * Member ID to set XP to + */ + userId: + | string + | "@me"; + requestBody: { + /** + * The total XP to set on the user + */ + total: number; + }; + }): CancelablePromise<{ + /** + * The total XP after this operation + */ + total: number; + }> { + return this.httpRequest.request( + { + method: "PUT", + url: "/servers/{serverId}/members/{userId}/xp", + path: { + serverId: serverId, + userId: userId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Bulk award XP to members - * Take note of the max number of `userIds` that can be submitted on each request. If you require more, please batch your requests - * @returns any Success - * @throws ApiError - */ - public serverXpForUserCreateMany({ - serverId, - requestBody, - }: { - serverId: string; - requestBody: { - /** - * The amount of XP to award - */ - amount: number; - userIds: Array; - }; - }): CancelablePromise<{ - /** - * Each key of the object will be a user ID, and its value will be the total for that user after this operation - */ - totalsByUserId: Record; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/servers/{serverId}/xp", - path: { - serverId: serverId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Bulk award XP to members + * Take note of the max number of `userIds` that can be submitted on each request. If you require more, please batch your requests + * @returns any Success + * @throws ApiError + */ + public serverXpForUserCreateMany({ + serverId, + requestBody, + }: { + serverId: string; + requestBody: { + /** + * The amount of XP to award + */ + amount: number; + userIds: Array< + | string + | "@me" + >; + }; + }): CancelablePromise<{ + /** + * Each key of the object will be a user ID, and its value will be the total for that user after this operation + */ + totalsByUserId: Record< + string, + number + >; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/servers/{serverId}/xp", + path: { + serverId: serverId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Bulk set members' XP - * Take note of the max number of `userIds` that can be submitted on each request. If you require more, please batch your requests - * @returns any Success - * @throws ApiError - */ - public serverXpForUserUpdateMany({ - serverId, - requestBody, - }: { - serverId: string; - requestBody: { - /** - * The total XP to set on each user - */ - total?: number; - userIds: Array; - }; - }): CancelablePromise<{ - /** - * Each key of the object will be a user ID, and its value will be the total for that user after this operation - */ - totalsByUserId: Record; - }> { - return this.httpRequest.request({ - method: "PUT", - url: "/servers/{serverId}/xp", - path: { - serverId: serverId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Bulk set members' XP + * Take note of the max number of `userIds` that can be submitted on each request. If you require more, please batch your requests + * @returns any Success + * @throws ApiError + */ + public serverXpForUserUpdateMany({ + serverId, + requestBody, + }: { + serverId: string; + requestBody: { + /** + * The total XP to set on each user + */ + total?: number; + userIds: Array< + | string + | "@me" + >; + }; + }): CancelablePromise<{ + /** + * Each key of the object will be a user ID, and its value will be the total for that user after this operation + */ + totalsByUserId: Record< + string, + number + >; + }> { + return this.httpRequest.request( + { + method: "PUT", + url: "/servers/{serverId}/xp", + path: { + serverId: serverId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Award XP to role - * Award XP to all members with a particular role. - * @returns void - * @throws ApiError - */ - public serverXpForRoleCreate({ - serverId, - roleId, - requestBody, - }: { - serverId: string; - /** - * Role ID to award XP to - */ - roleId: number; - requestBody: { - /** - * The amount of XP to award - */ - amount: number; - }; - }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/servers/{serverId}/roles/{roleId}/xp", - path: { - serverId: serverId, - roleId: roleId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Award XP to role + * Award XP to all members with a particular role. + * @returns void + * @throws ApiError + */ + public serverXpForRoleCreate({ + serverId, + roleId, + requestBody, + }: { + serverId: string; + /** + * Role ID to award XP to + */ + roleId: number; + requestBody: { + /** + * The amount of XP to award + */ + amount: number; + }; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "POST", + url: "/servers/{serverId}/roles/{roleId}/xp", + path: { + serverId: serverId, + roleId: roleId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/ServersService.ts b/packages/api/lib/generated/router/services/ServersService.ts index 66e0ca99..1fc76d46 100644 --- a/packages/api/lib/generated/router/services/ServersService.ts +++ b/packages/api/lib/generated/router/services/ServersService.ts @@ -4,27 +4,35 @@ /* eslint-disable */ import type { Server } from "../models/Server"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class ServersService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Get a server - * Fetch various information about a given server. Currently, the bot must be a member of the server in order to fetch its information. - * @returns any Success - * @throws ApiError - */ - public serverRead({ serverId }: { serverId: string }): CancelablePromise<{ - server: Server; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}", - path: { - serverId: serverId, - }, - }); - } + /** + * Get a server + * Fetch various information about a given server. Currently, the bot must be a member of the server in order to fetch its information. + * @returns any Success + * @throws ApiError + */ + public serverRead({ + serverId, + }: { + serverId: string; + }): CancelablePromise<{ + server: Server; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}", + path: { + serverId: serverId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/SocialLinksService.ts b/packages/api/lib/generated/router/services/SocialLinksService.ts index 59c50a5e..b2361563 100644 --- a/packages/api/lib/generated/router/services/SocialLinksService.ts +++ b/packages/api/lib/generated/router/services/SocialLinksService.ts @@ -4,39 +4,58 @@ /* eslint-disable */ import type { SocialLink } from "../models/SocialLink"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class SocialLinksService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Retrieves a member's public social links - * @returns any Success - * @throws ApiError - */ - public memberSocialLinkRead({ - serverId, - userId, - socialLinkType, - }: { - serverId: string; - userId: string | "@me"; - /** - * The type of social link to retrieve - */ - socialLinkType: "twitch" | "bnet" | "psn" | "xbox" | "steam" | "origin" | "youtube" | "twitter" | "facebook" | "switch" | "patreon" | "roblox" | "epic"; - }): CancelablePromise<{ - socialLink: SocialLink; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/members/{userId}/social-links/{socialLinkType}", - path: { - serverId: serverId, - userId: userId, - socialLinkType: socialLinkType, - }, - }); - } + /** + * Retrieves a member's public social links + * @returns any Success + * @throws ApiError + */ + public memberSocialLinkRead({ + serverId, + userId, + socialLinkType, + }: { + serverId: string; + userId: + | string + | "@me"; + /** + * The type of social link to retrieve + */ + socialLinkType: + | "twitch" + | "bnet" + | "psn" + | "xbox" + | "steam" + | "origin" + | "youtube" + | "twitter" + | "facebook" + | "switch" + | "patreon" + | "roblox" + | "epic"; + }): CancelablePromise<{ + socialLink: SocialLink; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/members/{userId}/social-links/{socialLinkType}", + path: { + serverId: serverId, + userId: userId, + socialLinkType: socialLinkType, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/UserStatusService.ts b/packages/api/lib/generated/router/services/UserStatusService.ts index 68417e77..d499eac4 100644 --- a/packages/api/lib/generated/router/services/UserStatusService.ts +++ b/packages/api/lib/generated/router/services/UserStatusService.ts @@ -1,63 +1,77 @@ +import type { BaseHttpRequest } from "../core/BaseHttpRequest"; /* generated using openapi-typescript-codegen -- do no edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { CancelablePromise } from "../core/CancelablePromise"; -import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export class UserStatusService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Update your status - * This value can be a max of 24 hours into the futre. If you are wanting a longer expiration, set this value to null so that it never expires. **Note** - at this time, you can only set a status on your own user - * @returns void - * @throws ApiError - */ - public userStatusCreate({ - userId, - requestBody, - }: { - userId: string | "@me"; - requestBody: { - /** - * The content of the user status. The supported markdown for this content only includes reactions and plaintext for now - */ - content?: string; - /** - * Emote ID to apply - */ - emoteId: number; - /** - * An ISO 8601 timestamp that will be used to indicate when an expiration occurs. Expiration usually will not occur exactly at this time. Bot logic should not expect a guarantee of timing as a result, but can expect that it'll happen very shortly afterwards - */ - expiresAt?: string; - }; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/users/{userId}/status", - path: { - userId: userId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update your status + * This value can be a max of 24 hours into the futre. If you are wanting a longer expiration, set this value to null so that it never expires. **Note** - at this time, you can only set a status on your own user + * @returns void + * @throws ApiError + */ + public userStatusCreate({ + userId, + requestBody, + }: { + userId: + | string + | "@me"; + requestBody: { + /** + * The content of the user status. The supported markdown for this content only includes reactions and plaintext for now + */ + content?: string; + /** + * Emote ID to apply + */ + emoteId: number; + /** + * An ISO 8601 timestamp that will be used to indicate when an expiration occurs. Expiration usually will not occur exactly at this time. Bot logic should not expect a guarantee of timing as a result, but can expect that it'll happen very shortly afterwards + */ + expiresAt?: string; + }; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "PUT", + url: "/users/{userId}/status", + path: { + userId: userId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete your status - * **Note** - at this time, you can only set a status on your own user - * @returns void - * @throws ApiError - */ - public userStatusDelete({ userId }: { userId: string | "@me" }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/users/{userId}/status", - path: { - userId: userId, - }, - }); - } + /** + * Delete your status + * **Note** - at this time, you can only set a status on your own user + * @returns void + * @throws ApiError + */ + public userStatusDelete({ + userId, + }: { + userId: + | string + | "@me"; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/users/{userId}/status", + path: { + userId: userId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/UsersService.ts b/packages/api/lib/generated/router/services/UsersService.ts index 997fab0a..8b182118 100644 --- a/packages/api/lib/generated/router/services/UsersService.ts +++ b/packages/api/lib/generated/router/services/UsersService.ts @@ -5,45 +5,63 @@ import type { Server } from "../models/Server"; import type { User } from "../models/User"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class UsersService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Get a user - * **Note** - at this time, you can only retrieve your own user - * @returns any Success - * @throws ApiError - */ - public userRead({ userId }: { userId: string | "@me" }): CancelablePromise<{ - user: User; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/users/{userId}", - path: { - userId: userId, - }, - }); - } + /** + * Get a user + * **Note** - at this time, you can only retrieve your own user + * @returns any Success + * @throws ApiError + */ + public userRead({ + userId, + }: { + userId: + | string + | "@me"; + }): CancelablePromise<{ + user: User; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/users/{userId}", + path: { + userId: userId, + }, + }, + ); + } - /** - * Get a users servers - * **Note** - at this time, you can only retrieve your own servers - * @returns any Success - * @throws ApiError - */ - public userServerReadMany({ userId }: { userId: string | "@me" }): CancelablePromise<{ - servers: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/users/{userId}/servers", - path: { - userId: userId, - }, - }); - } + /** + * Get a users servers + * **Note** - at this time, you can only retrieve your own servers + * @returns any Success + * @throws ApiError + */ + public userServerReadMany({ + userId, + }: { + userId: + | string + | "@me"; + }): CancelablePromise<{ + servers: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/users/{userId}/servers", + path: { + userId: userId, + }, + }, + ); + } } diff --git a/packages/api/lib/generated/router/services/WebhookService.ts b/packages/api/lib/generated/router/services/WebhookService.ts index 7bd92f8b..b9379c0c 100644 --- a/packages/api/lib/generated/router/services/WebhookService.ts +++ b/packages/api/lib/generated/router/services/WebhookService.ts @@ -4,144 +4,168 @@ /* eslint-disable */ import type { Webhook } from "../models/Webhook"; -import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; +import type { CancelablePromise } from "../core/CancelablePromise"; export class WebhookService { - constructor(public readonly httpRequest: BaseHttpRequest) {} + constructor( + public readonly httpRequest: BaseHttpRequest, + ) {} - /** - * Create a webhook - * @returns any Success - * @throws ApiError - */ - public webhookCreate({ - serverId, - requestBody, - }: { - serverId: string; - requestBody: { - /** - * The name of the webhook - */ - name: string; - /** - * Channel ID to create the webhook in - */ - channelId: string; - }; - }): CancelablePromise<{ - webhook: Webhook; - }> { - return this.httpRequest.request({ - method: "POST", - url: "/servers/{serverId}/webhooks", - path: { - serverId: serverId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Create a webhook + * @returns any Success + * @throws ApiError + */ + public webhookCreate({ + serverId, + requestBody, + }: { + serverId: string; + requestBody: { + /** + * The name of the webhook + */ + name: string; + /** + * Channel ID to create the webhook in + */ + channelId: string; + }; + }): CancelablePromise<{ + webhook: Webhook; + }> { + return this.httpRequest.request( + { + method: "POST", + url: "/servers/{serverId}/webhooks", + path: { + serverId: serverId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Get a server's webhooks - * Get a list of webhooks from a server. - * @returns any Success - * @throws ApiError - */ - public webhookReadMany({ - serverId, - channelId, - }: { - serverId: string; - /** - * ID of the channel you want to filter for webhooks - */ - channelId: string; - }): CancelablePromise<{ - webhooks: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/webhooks", - path: { - serverId: serverId, - }, - query: { - channelId: channelId, - }, - }); - } + /** + * Get a server's webhooks + * Get a list of webhooks from a server. + * @returns any Success + * @throws ApiError + */ + public webhookReadMany({ + serverId, + channelId, + }: { + serverId: string; + /** + * ID of the channel you want to filter for webhooks + */ + channelId: string; + }): CancelablePromise<{ + webhooks: Array; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/webhooks", + path: { + serverId: serverId, + }, + query: { + channelId: channelId, + }, + }, + ); + } - /** - * Get a server's webhook - * @returns any Success - * @throws ApiError - */ - public webhookRead({ serverId, webhookId }: { serverId: string; webhookId: string }): CancelablePromise<{ - webhook: Webhook; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/servers/{serverId}/webhooks/{webhookId}", - path: { - serverId: serverId, - webhookId: webhookId, - }, - }); - } + /** + * Get a server's webhook + * @returns any Success + * @throws ApiError + */ + public webhookRead({ + serverId, + webhookId, + }: { + serverId: string; + webhookId: string; + }): CancelablePromise<{ + webhook: Webhook; + }> { + return this.httpRequest.request( + { + method: "GET", + url: "/servers/{serverId}/webhooks/{webhookId}", + path: { + serverId: serverId, + webhookId: webhookId, + }, + }, + ); + } - /** - * Update a webhook - * @returns any Success - * @throws ApiError - */ - public webhookUpdate({ - serverId, - webhookId, - requestBody, - }: { - serverId: string; - webhookId: string; - requestBody: { - /** - * The name of the webhook - */ - name: string; - /** - * The ID of the channel - */ - channelId?: string; - }; - }): CancelablePromise<{ - webhook: Webhook; - }> { - return this.httpRequest.request({ - method: "PUT", - url: "/servers/{serverId}/webhooks/{webhookId}", - path: { - serverId: serverId, - webhookId: webhookId, - }, - body: requestBody, - mediaType: "application/json", - }); - } + /** + * Update a webhook + * @returns any Success + * @throws ApiError + */ + public webhookUpdate({ + serverId, + webhookId, + requestBody, + }: { + serverId: string; + webhookId: string; + requestBody: { + /** + * The name of the webhook + */ + name: string; + /** + * The ID of the channel + */ + channelId?: string; + }; + }): CancelablePromise<{ + webhook: Webhook; + }> { + return this.httpRequest.request( + { + method: "PUT", + url: "/servers/{serverId}/webhooks/{webhookId}", + path: { + serverId: serverId, + webhookId: webhookId, + }, + body: requestBody, + mediaType: "application/json", + }, + ); + } - /** - * Delete a server webhook - * @returns void - * @throws ApiError - */ - public webhookDelete({ serverId, webhookId }: { serverId: string; webhookId: string }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/servers/{serverId}/webhooks/{webhookId}", - path: { - serverId: serverId, - webhookId: webhookId, - }, - }); - } + /** + * Delete a server webhook + * @returns void + * @throws ApiError + */ + public webhookDelete({ + serverId, + webhookId, + }: { + serverId: string; + webhookId: string; + }): CancelablePromise { + return this.httpRequest.request( + { + method: "DELETE", + url: "/servers/{serverId}/webhooks/{webhookId}", + path: { + serverId: serverId, + webhookId: webhookId, + }, + }, + ); + } } diff --git a/packages/api/lib/rest/RestManager.ts b/packages/api/lib/rest/RestManager.ts index a56c110f..08d07a5a 100644 --- a/packages/api/lib/rest/RestManager.ts +++ b/packages/api/lib/rest/RestManager.ts @@ -13,7 +13,7 @@ import type { RestOptions } from "./typings"; let HTTPFetch = globalThis.fetch; if (!HTTPFetch) { - HTTPFetch = require("node-fetch"); + HTTPFetch = require("node-fetch"); } const packageDetails = require("../../package.json"); @@ -21,248 +21,260 @@ const packageDetails = require("../../package.json"); const sleep = async (ms: number): Promise => new Promise((resolve) => setTimeout(resolve, ms)); export type RequestOptions = { - body?: BodyInit | Buffer; - headers: Record; - method: HTTPMethods; - url: string; + body?: BodyInit | Buffer; + headers: Record; + method: HTTPMethods; + url: string; }; export type ResponseDetails = { - body: JSONB | string; - headers: Record; - status: number; + body: JSONB | string; + headers: Record; + status: number; }; export type RestManagerEvents = { - request(request: RequestOptions): void; - error(req: RequestOptions, res: ResponseDetails): void; - ratelimit(ratelimit: RequestOptions & { responseHeaders: Record }): void; + request(request: RequestOptions): void; + error(req: RequestOptions, res: ResponseDetails): void; + ratelimit( + ratelimit: RequestOptions & { + responseHeaders: Record; + }, + ): void; }; export class RestManager { - /** - * The bot token to be used for making requests. - */ - token = this.options.token; - - /** - * The version of the API to be used for making requests. By default, this will use the latest version that the library supports. - */ - version = this.options.version ?? 1; - - /** - * The proxy url if it was set. - */ - proxyURL = this.options.proxyURL; - - /** - * Logging emitter - */ - readonly emitter = new EventEmitter() as TypedEmitter; - - /** - * Utility router - */ - readonly router = new GuildedRouter(this); - - constructor(public readonly options: RestOptions) {} - - /** - * The base url to send the request to. - */ - get baseURL(): string { - return this.proxyURL ?? `https://www.guilded.gg/api/v${this.version}`; - } - - /** - * Generate obfuscated token. It replaces every char in a non-even index with X. I'm not very creative. - */ - get obfuscatedToken(): string { - return this.token - .split("") - .map(() => "X") - .join(""); - } - - public async make( - data: MakeOptions, - authenticated = true, - retryCount = 0, - { returnAsText = false, bodyIsJSON = true }: { bodyIsJSON?: boolean; returnAsText?: boolean } = {}, - ): Promise<[Response, Promise]> { - const headers: HeadersInit = {}; - // If this request requires authentication, add the Bearer token as a header. - if (authenticated) headers.Authorization = `Bearer ${this.token}`; - - // Append stringified query params to the URL. This doesn't append the base URL yet. - const queryAppendedURL = data.query ? `${data.path}?${stringify(data.query)}` : data.path; - - // All options to be sent with the request - const requestOptions: RequestOptions = { - url: this.baseURL + queryAppendedURL, - headers: { - // This gets changed later on if the request is formdata. - "content-type": "application/json", - // Used for logging on Guilded end. - "User-Agent": `@guildedjs-rest/${packageDetails.version} Node.js ${process.version}`, - // Spread the other headers like authentication. - ...headers, - // Spread any additional headers passed from the method. - ...data.headers, - }, - method: data.method, - }; - - // This mostly only applies to Webhook routes that allow you to attach files. - if (data.body instanceof FormData) { - // Turn the formdata into a buffer. - requestOptions.body = data.body.getBuffer(); - // Merge the formdata generated boundary headers with the request headers. This will replace things like content-type and other conflicting headers. - Object.assign(requestOptions.headers, { ...data.body.getHeaders() }); - } else if (bodyIsJSON) { - // Turn JSON data into string. - requestOptions.body = JSON.stringify(data.body); - } - - this.emitter.emit("request", requestOptions); - // The reason we're hoisting the variable like this is so that we can have error handling for the underlying fetch request. - let response; - try { - response = await HTTPFetch(requestOptions.url, requestOptions); - } catch (error: any) { - throw new Error(`Error while making API call, ${error.message.toString()}`); - } - - if (!response.ok) { - const mapHeadersToObj: Record = {}; - // This is done because Headers isn't stringifiable or iterable without the use of the forEach method. - // eslint-disable-next-line unicorn/no-array-for-each - response.headers.forEach((v, k) => { - mapHeadersToObj[k] = v; - }); - - // Occurs when ratelimited. - if (response.status === 429) { - const retryAfterTime = Number(response.headers.get("Retry-After") ?? 35); - - // Check if request has failed 3+ times. - if (retryCount >= (this.options?.maxRatelimitRetryLimit ?? 3)) { - throw new Error("MAX REQUEST RATELIMIT RETRY LIMIT REACHED."); - } - - this.emitter.emit("ratelimit", { - ...requestOptions, - responseHeaders: mapHeadersToObj, - }); - // Make the thread wait the amount of time specified in the Retry-After before retrying request. - await sleep(retryAfterTime * 1_000); - return this.make(data, authenticated, ++retryCount); - } - - // Parse error response as text. The reason this isn't in the try/catch statement is because of the HEAD method not returning json. - const rawResponse: string = await response.text().catch(() => "Could not read underlying response body buffer"); // this shouldn't happen - let parsedResponse: any | string = rawResponse; - let errorMessage: string = parsedResponse; - - if (requestOptions.method !== "HEAD" && response.status !== 204) { - // json body won't be returned in these cases, so don't attempt to parse as json - try { - parsedResponse = JSON.parse(rawResponse); - errorMessage = parsedResponse.message; - } catch { - // response was still malformed somehow; just allow it to be reported as text - } - } - - // Details response object for error reporting. - const responseDetails: ResponseDetails = { - status: response.status, - headers: mapHeadersToObj, - body: parsedResponse, - }; - - // obfuscate token in requestOptions for logging purposes. - requestOptions.headers.Authorization = "[OBFUSCATED]"; - - // parse stringified JSON bodies back to JSON (added bonus of being able to check here if anything went wrong during the stringifying with any toJSON overrides) - if (bodyIsJSON && typeof requestOptions.body === "string") requestOptions.body = JSON.parse(requestOptions.body); - - // this.emitter.emit("error", requestOptions, responseDetails); - // Occurs when bot has a permission missing - if (responseDetails.status === 403) { - throw new PermissionsError(errorMessage, requestOptions, responseDetails); - } - - throw new GuildedAPIError(errorMessage, requestOptions, responseDetails); - } - - return [response, returnAsText ? response.text() : (response.json().catch(() => ({})) as Promise)]; - } - - public async get(path: string, query?: Q, authenticated = true): Promise { - return this.make( - { - method: "GET", - path, - query, - }, - authenticated, - ).then(async (x) => x[1] as Promise); - } - - public async post(path: string, body?: B, authenticated = true): Promise { - return this.make( - { - body, - method: "POST", - path, - }, - authenticated, - ).then(async (x) => x[1] as Promise); - } - - public async delete(path: string, body?: B, authenticated = true): Promise { - return this.make( - { - body, - method: "DELETE", - path, - }, - authenticated, - ).then(async (x) => x[1] as Promise); - } - - public async patch(path: string, body: B, authenticated = true): Promise { - return this.make( - { - body, - method: "PATCH", - path, - }, - authenticated, - ).then(async (x) => x[1] as Promise); - } - - public async put(path: string, body?: B, authenticated = true): Promise { - return this.make( - { - body, - method: "PUT", - path, - }, - authenticated, - ).then(async (x) => x[1] as Promise); - } + /** + * The bot token to be used for making requests. + */ + token = this.options.token; + + /** + * The version of the API to be used for making requests. By default, this will use the latest version that the library supports. + */ + version = this.options.version ?? 1; + + /** + * The proxy url if it was set. + */ + proxyURL = this.options.proxyURL; + + /** + * Logging emitter + */ + readonly emitter = new EventEmitter() as TypedEmitter; + + /** + * Utility router + */ + readonly router = new GuildedRouter(this); + + constructor(public readonly options: RestOptions) {} + + /** + * The base url to send the request to. + */ + get baseURL(): string { + return this.proxyURL ?? `https://www.guilded.gg/api/v${this.version}`; + } + + /** + * Generate obfuscated token. It replaces every char in a non-even index with X. I'm not very creative. + */ + get obfuscatedToken(): string { + return this.token + .split("") + .map(() => "X") + .join(""); + } + + public async make( + data: MakeOptions, + authenticated = true, + retryCount = 0, + { + returnAsText = false, + bodyIsJSON = true, + }: { + bodyIsJSON?: boolean; + returnAsText?: boolean; + } = {}, + ): Promise<[Response, Promise]> { + const headers: HeadersInit = {}; + // If this request requires authentication, add the Bearer token as a header. + if (authenticated) headers.Authorization = `Bearer ${this.token}`; + + // Append stringified query params to the URL. This doesn't append the base URL yet. + const queryAppendedURL = data.query ? `${data.path}?${stringify(data.query)}` : data.path; + + // All options to be sent with the request + const requestOptions: RequestOptions = { + url: this.baseURL + queryAppendedURL, + headers: { + // This gets changed later on if the request is formdata. + "content-type": "application/json", + // Used for logging on Guilded end. + "User-Agent": `@guildedjs-rest/${packageDetails.version} Node.js ${process.version}`, + // Spread the other headers like authentication. + ...headers, + // Spread any additional headers passed from the method. + ...data.headers, + }, + method: data.method, + }; + + // This mostly only applies to Webhook routes that allow you to attach files. + if (data.body instanceof FormData) { + // Turn the formdata into a buffer. + requestOptions.body = data.body.getBuffer(); + // Merge the formdata generated boundary headers with the request headers. This will replace things like content-type and other conflicting headers. + Object.assign(requestOptions.headers, { + ...data.body.getHeaders(), + }); + } else if (bodyIsJSON) { + // Turn JSON data into string. + requestOptions.body = JSON.stringify(data.body); + } + + this.emitter.emit("request", requestOptions); + // The reason we're hoisting the variable like this is so that we can have error handling for the underlying fetch request. + let response: Response; + try { + response = await HTTPFetch(requestOptions.url, requestOptions); + } catch (error) { + throw new Error(`Error while making API call, ${(error as Error).message.toString()}`); + } + + if (!response.ok) { + const mapHeadersToObj: Record = {}; + // This is done because Headers isn't stringifiable or iterable without the use of the forEach method. + // eslint-disable-next-line unicorn/no-array-for-each + response.headers.forEach((v, k) => { + mapHeadersToObj[k] = v; + }); + + // Occurs when ratelimited. + if (response.status === 429) { + const retryAfterTime = Number(response.headers.get("Retry-After") ?? 35); + + // Check if request has failed 3+ times. + if (retryCount >= (this.options?.maxRatelimitRetryLimit ?? 3)) { + throw new Error("MAX REQUEST RATELIMIT RETRY LIMIT REACHED."); + } + + this.emitter.emit("ratelimit", { + ...requestOptions, + responseHeaders: mapHeadersToObj, + }); + // Make the thread wait the amount of time specified in the Retry-After before retrying request. + await sleep(retryAfterTime * 1_000); + return this.make(data, authenticated, ++retryCount); + } + + // Parse error response as text. The reason this isn't in the try/catch statement is because of the HEAD method not returning json. + const rawResponse: string = await response.text().catch(() => "Could not read underlying response body buffer"); // this shouldn't happen + const parsedResponse: string = rawResponse; + let errorMessage: string = parsedResponse; + + if (requestOptions.method !== "HEAD" && response.status !== 204) { + // json body won't be returned in these cases, so don't attempt to parse as json + try { + errorMessage = JSON.parse(rawResponse).message; + } catch { + // response was still malformed somehow; just allow it to be reported as text + } + } + + // Details response object for error reporting. + const responseDetails: ResponseDetails = { + status: response.status, + headers: mapHeadersToObj, + body: parsedResponse, + }; + + // obfuscate token in requestOptions for logging purposes. + requestOptions.headers.Authorization = "[OBFUSCATED]"; + + // parse stringified JSON bodies back to JSON (added bonus of being able to check here if anything went wrong during the stringifying with any toJSON overrides) + if (bodyIsJSON && typeof requestOptions.body === "string") requestOptions.body = JSON.parse(requestOptions.body); + + // this.emitter.emit("error", requestOptions, responseDetails); + // Occurs when bot has a permission missing + if (responseDetails.status === 403) { + throw new PermissionsError(errorMessage, requestOptions, responseDetails); + } + + throw new GuildedAPIError(errorMessage, requestOptions, responseDetails); + } + + return [response, returnAsText ? response.text() : (response.json().catch(() => ({})) as Promise)]; + } + + public async get(path: string, query?: Q, authenticated = true): Promise { + return this.make( + { + method: "GET", + path, + query, + }, + authenticated, + ).then(async (x) => x[1] as Promise); + } + + public async post(path: string, body?: B, authenticated = true): Promise { + return this.make( + { + body, + method: "POST", + path, + }, + authenticated, + ).then(async (x) => x[1] as Promise); + } + + public async delete(path: string, body?: B, authenticated = true): Promise { + return this.make( + { + body, + method: "DELETE", + path, + }, + authenticated, + ).then(async (x) => x[1] as Promise); + } + + public async patch(path: string, body: B, authenticated = true): Promise { + return this.make( + { + body, + method: "PATCH", + path, + }, + authenticated, + ).then(async (x) => x[1] as Promise); + } + + public async put(path: string, body?: B, authenticated = true): Promise { + return this.make( + { + body, + method: "PUT", + path, + }, + authenticated, + ).then(async (x) => x[1] as Promise); + } } export type MakeOptions = { - body?: B | FormData; - headers?: Record; - isFormData?: boolean; - method: HTTPMethods; - path: string; - query?: Q; + body?: B | FormData; + headers?: Record; + isFormData?: boolean; + method: HTTPMethods; + path: string; + query?: Q; }; +// biome-ignore lint/suspicious/noExplicitAny: export type JSONB = Record; export type HTTPMethods = "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT"; export type RequestBodyObject = JSONB | undefined; diff --git a/packages/api/lib/rest/errors/GuildedAPIError.ts b/packages/api/lib/rest/errors/GuildedAPIError.ts index 78ec1661..e100061a 100644 --- a/packages/api/lib/rest/errors/GuildedAPIError.ts +++ b/packages/api/lib/rest/errors/GuildedAPIError.ts @@ -3,7 +3,11 @@ import type { RequestOptions, ResponseDetails } from "../RestManager"; export class GuildedAPIError extends Error { - public constructor(msg: string, public readonly request: RequestOptions, public readonly response: ResponseDetails) { - super(`[GuildedAPIError:${response.status}:${request.method.toUpperCase()}] ${request.url} - ${msg}`); - } + public constructor( + msg: string, + public readonly request: RequestOptions, + public readonly response: ResponseDetails, + ) { + super(`[GuildedAPIError:${response.status}:${request.method.toUpperCase()}] ${request.url} - ${msg}`); + } } diff --git a/packages/api/lib/rest/errors/PermissionsError.ts b/packages/api/lib/rest/errors/PermissionsError.ts index 8732e1ba..ad63e09a 100644 --- a/packages/api/lib/rest/errors/PermissionsError.ts +++ b/packages/api/lib/rest/errors/PermissionsError.ts @@ -1,8 +1,4 @@ import type { RequestOptions, ResponseDetails } from "../RestManager"; import { GuildedAPIError } from "./GuildedAPIError"; -export class PermissionsError extends GuildedAPIError { - public constructor(msg: string, request: RequestOptions, response: ResponseDetails) { - super(msg, request, response); - } -} +export class PermissionsError extends GuildedAPIError {} diff --git a/packages/api/lib/rest/typings.ts b/packages/api/lib/rest/typings.ts index ade20cbf..73a2bd04 100644 --- a/packages/api/lib/rest/typings.ts +++ b/packages/api/lib/rest/typings.ts @@ -1,22 +1,22 @@ export type RestOptions = { - /** - * How many times to retry a request that's been ratelimited before failing - */ - maxRatelimitRetryLimit?: number; - /** - * The base url of the API you want to send requests to. By default, this will send it to guilded's rest API. This is meant for big bot developers who want to use a proxy rest system. - */ - proxyURL?: string; - /** - * How long to delay each request by. - */ - restOffset?: number; - /** - * The bot token to be used for making requests. - */ - token: string; - /** - * The version of the API to be used for making requests. By default, this will use the latest version that the library supports. - */ - version?: 1; + /** + * How many times to retry a request that's been ratelimited before failing + */ + maxRatelimitRetryLimit?: number; + /** + * The base url of the API you want to send requests to. By default, this will send it to guilded's rest API. This is meant for big bot developers who want to use a proxy rest system. + */ + proxyURL?: string; + /** + * How long to delay each request by. + */ + restOffset?: number; + /** + * The bot token to be used for making requests. + */ + token: string; + /** + * The version of the API to be used for making requests. By default, this will use the latest version that the library supports. + */ + version?: 1; }; diff --git a/packages/api/lib/rest/util/color.ts b/packages/api/lib/rest/util/color.ts index 07c9ba5c..021000f5 100644 --- a/packages/api/lib/rest/util/color.ts +++ b/packages/api/lib/rest/util/color.ts @@ -4,35 +4,35 @@ * Taken from https://github.com/discordjs/discord.js/blob/stable/src/util/Constants.js */ export const COLORS: { [key: string]: number } = { - AQUA: 0x1abc9c, - BLUE: 0x3498db, - DARKER_GREY: 0x7f8c8d, - DARK_AQUA: 0x11806a, - DARK_BLUE: 0x206694, - DARK_BUT_NOT_BLACK: 0x2c2f33, - DARK_GOLD: 0xc27c0e, - DARK_GREEN: 0x1f8b4c, - DARK_GREY: 0x979c9f, - DARK_NAVY: 0x2c3e50, - DARK_ORANGE: 0xa84300, - DARK_PURPLE: 0x71368a, - DARK_RED: 0x992d22, - DARK_VIVID_PINK: 0xad1457, - DEFAULT: 0x000000, - GOLD: 0xf1c40f, - GREEN: 0x2ecc71, - GREY: 0x95a5a6, - GREYPLE: 0x99aab5, - GUILDED: 0xf5c400, - LIGHT_GREY: 0xbcc0c0, - LUMINOUS_VIVID_PINK: 0xe91e63, - NAVY: 0x34495e, - NOT_QUITE_BLACK: 0x23272a, - ORANGE: 0xe67e22, - PURPLE: 0x9b59b6, - RED: 0xe74c3c, - WHITE: 0xffffff, - YELLOW: 0xffff00, + AQUA: 0x1abc9c, + BLUE: 0x3498db, + DARKER_GREY: 0x7f8c8d, + DARK_AQUA: 0x11806a, + DARK_BLUE: 0x206694, + DARK_BUT_NOT_BLACK: 0x2c2f33, + DARK_GOLD: 0xc27c0e, + DARK_GREEN: 0x1f8b4c, + DARK_GREY: 0x979c9f, + DARK_NAVY: 0x2c3e50, + DARK_ORANGE: 0xa84300, + DARK_PURPLE: 0x71368a, + DARK_RED: 0x992d22, + DARK_VIVID_PINK: 0xad1457, + DEFAULT: 0x000000, + GOLD: 0xf1c40f, + GREEN: 0x2ecc71, + GREY: 0x95a5a6, + GREYPLE: 0x99aab5, + GUILDED: 0xf5c400, + LIGHT_GREY: 0xbcc0c0, + LUMINOUS_VIVID_PINK: 0xe91e63, + NAVY: 0x34495e, + NOT_QUITE_BLACK: 0x23272a, + ORANGE: 0xe67e22, + PURPLE: 0x9b59b6, + RED: 0xe74c3c, + WHITE: 0xffffff, + YELLOW: 0xffff00, } as const; /** @@ -41,15 +41,15 @@ export const COLORS: { [key: string]: number } = { * Taken from https://github.com/discordjs/discord.js/blob/stable/src/util/Util.js#L436 */ export function resolveColor(color: number | string | [number, number, number]): number { - if (typeof color === "string") { - if (color === "RANDOM") return Math.floor(Math.random() * (0xffffff + 1)); - color = COLORS[color.toUpperCase()] ?? Number.parseInt(color.replace("#", ""), 16); - } else if (Array.isArray(color)) { - color = (color[0] << 16) + (color[1] << 8) + color[2]; - } + if (typeof color === "string") { + if (color === "RANDOM") return Math.floor(Math.random() * (0xffffff + 1)); + color = COLORS[color.toUpperCase()] ?? Number.parseInt(color.replace("#", ""), 16); + } else if (Array.isArray(color)) { + color = (color[0] << 16) + (color[1] << 8) + color[2]; + } - if (color < 0 || color > 0xffffff) throw new RangeError("COLOR_RANGE"); - else if (Number.isNaN(color)) throw new TypeError("COLOR_CONVERT"); + if (color < 0 || color > 0xffffff) throw new RangeError("COLOR_RANGE"); + if (Number.isNaN(color)) throw new TypeError("COLOR_CONVERT"); - return color; + return color; } diff --git a/packages/api/lib/rest/util/constants.ts b/packages/api/lib/rest/util/constants.ts index 9eaeaf78..4a6a4ee2 100644 --- a/packages/api/lib/rest/util/constants.ts +++ b/packages/api/lib/rest/util/constants.ts @@ -2,17 +2,17 @@ * The meanings of each of the known guilded api response status codes. */ export const GUILDED_STATUS_CODES = { - 200: "The request was successful" as const, - 201: "The content was created" as const, - 204: "No content returned" as const, - 400: "The request was unacceptable, often due to missing parameters" as const, - 401: "The access token is missing or invalid" as const, - 403: "The bot does not have the necessary permissions" as const, - 404: "The requested resource does not exist" as const, - 409: "The request conflicted with another request" as const, - 500: "Something went wrong on our end" as const, - 501: "Something went wrong on our end" as const, - 502: "Something went wrong on our end" as const, - 503: "Something went wrong on our end" as const, - 504: "Something went wrong on our end" as const, + 200: "The request was successful" as const, + 201: "The content was created" as const, + 204: "No content returned" as const, + 400: "The request was unacceptable, often due to missing parameters" as const, + 401: "The access token is missing or invalid" as const, + 403: "The bot does not have the necessary permissions" as const, + 404: "The requested resource does not exist" as const, + 409: "The request conflicted with another request" as const, + 500: "Something went wrong on our end" as const, + 501: "Something went wrong on our end" as const, + 502: "Something went wrong on our end" as const, + 503: "Something went wrong on our end" as const, + 504: "Something went wrong on our end" as const, }; diff --git a/packages/api/lib/rest/util/message.ts b/packages/api/lib/rest/util/message.ts index ba3a2e99..f6b12a74 100644 --- a/packages/api/lib/rest/util/message.ts +++ b/packages/api/lib/rest/util/message.ts @@ -3,53 +3,53 @@ import type { APIContent, APIEmbed, RESTPostWebhookBody } from "../../generated/ import { WebhookEmbed } from "../webhook/WebhookEmbed"; export type MessageAttachment = { - content?: Buffer; - name: string; - path?: string; + content?: Buffer; + name: string; + path?: string; }; export type WebhookMessageContent = - | string - | (RESTPostWebhookBody & { - embeds?: (APIEmbed | WebhookEmbed)[]; - files?: MessageAttachment[]; - }); + | string + | (RESTPostWebhookBody & { + embeds?: (APIEmbed | WebhookEmbed)[]; + files?: MessageAttachment[]; + }); export const transformEmbedToAPIEmbed = (embeds: (APIEmbed | WebhookEmbed)[]): APIEmbed[] => embeds.map((x) => (x instanceof WebhookEmbed ? x.toJSON() : x)); export function parseToMessage(input: EmbedStructure | string = "", embed?: EmbedStructure): APIContent { - return { - document: { - data: {}, - nodes: [ - { - data: {}, - nodes: [ - { - leaves: [ - { - marks: [], - object: "leaf", - text: typeof input === "string" ? input : "", - }, - ], - object: "text", - }, - ], - object: "block", - type: "markdown-plain-text", - }, - { - data: { - embeds: embed ? (embed instanceof WebhookEmbed ? [embed?.toJSON()] : [embed]) : typeof input === "string" ? [] : input instanceof WebhookEmbed ? [input?.toJSON()] : [input], - }, - nodes: [], - object: "block", - type: "webhookMessage", - }, - ], - object: "document", - }, - object: "value", - }; + return { + document: { + data: {}, + nodes: [ + { + data: {}, + nodes: [ + { + leaves: [ + { + marks: [], + object: "leaf", + text: typeof input === "string" ? input : "", + }, + ], + object: "text", + }, + ], + object: "block", + type: "markdown-plain-text", + }, + { + data: { + embeds: embed ? (embed instanceof WebhookEmbed ? [embed?.toJSON()] : [embed]) : typeof input === "string" ? [] : input instanceof WebhookEmbed ? [input?.toJSON()] : [input], + }, + nodes: [], + object: "block", + type: "webhookMessage", + }, + ], + object: "document", + }, + object: "value", + }; } /** @@ -58,207 +58,223 @@ export function parseToMessage(input: EmbedStructure | string = "", embed?: Embe * @internal */ export function parseMessage(data: APIContent): parsedMessage { - const parsedMessageArray: parsedTextResponse[] = []; - let parsedMessageTextContent = ""; - const mentions: { - channels: string[]; - reactions: string[]; - roles: string[]; - users: string[]; - } = { - channels: [], - reactions: [], - roles: [], - users: [], - }; - const embeds: APIEmbed[] = []; - const messageLinesWithoutEmpty = data.document.nodes.filter((x) => (x.type === "webhookMessage" ? (x.data as { embeds: APIEmbed[] }).embeds.length > 0 : true)); - - for (let index = 0; index < messageLinesWithoutEmpty.length; index++) { - const messageLine = data.document.nodes[index]; - if (index) parsedMessageTextContent += "\n"; - switch (messageLine.type) { - case "paragraph": { - for (const node of messageLine.nodes) { - switch (node.object) { - case "text": { - for (const leaf of node.leaves!) { - if (leaf.text) { - parsedMessageArray.push({ - content: leaf.text, - type: "text", - }); - } - - parsedMessageTextContent += leaf.text; - } - - break; - } - - case "inline": { - const castedDataNode = node.data as MessageDataNode; - const leaf = node.nodes![0].leaves![0]; - switch (node.type) { - case "mention": { - switch (castedDataNode.mention!.type) { - case "person": { - mentions.users.push(castedDataNode.mention!.id as string); - parsedMessageArray.push({ - content: leaf.text, - mention: castedDataNode.mention, - type: "user", - }); - break; - } - - case "role": { - parsedMessageArray.push({ - content: leaf.text, - mention: castedDataNode.mention, - type: "role", - }); - mentions.roles.push(castedDataNode.mention!.id.toString()); - break; - } - } - - break; - } - - /* istanbul ignore next */ - case "reaction": { - mentions.reactions.push(castedDataNode.reaction!.id); - parsedMessageArray.push({ - content: leaf.text, - reaction: castedDataNode.reaction, - type: "reaction", - }); - break; - } - - case "channel": { - mentions.channels.push(castedDataNode.channel!.id); - parsedMessageArray.push({ - channel: castedDataNode.channel, - content: leaf.text, - type: "channel", - }); - break; - } - } - - parsedMessageTextContent += leaf.text; - break; - } - } - } - - break; - } - - /* istanbul ignore next */ - case "block-quote-container": { - for (const messageNodes of messageLine.nodes) { - for (const node of messageNodes.nodes!) { - switch (node.object) { - case "text": { - if (node.leaves![0].text) { - parsedMessageArray.push({ - content: node.leaves![0].text, - type: "text", - }); - } - - parsedMessageTextContent += node.leaves![0].text; - break; - } - - case "inline": { - const castedDataNode = node.data as MessageDataNode; - switch (node.type) { - case "mention": { - switch (castedDataNode.mention!.type) { - case "person": { - mentions.users.push(castedDataNode.mention!.id as string); - parsedMessageArray.push({ - content: node.nodes![0].leaves![0].text, - mention: castedDataNode.mention, - type: "user", - }); - break; - } - - case "role": { - parsedMessageArray.push({ - content: node.nodes![0].leaves![0].text, - mention: castedDataNode.mention, - type: "role", - }); - mentions.roles.push(castedDataNode.mention!.id.toString()); - break; - } - } - - break; - } - - case "reaction": { - mentions.reactions.push(castedDataNode.reaction!.id); - parsedMessageArray.push({ - content: node.nodes![0].leaves![0].text, - reaction: castedDataNode.reaction, - type: "reaction", - }); - break; - } - - case "channel": { - mentions.channels.push(castedDataNode.channel!.id); - parsedMessageArray.push({ - channel: castedDataNode.channel, - content: node.nodes![0].leaves![0].text, - type: "channel", - }); - break; - } - } - - parsedMessageTextContent += node.nodes![0].leaves![0].text; - break; - } - } - } - } - - break; - } - - case "markdown-plain-text": { - if (messageLine.nodes![0].leaves![0].text) { - parsedMessageArray.push({ - content: messageLine.nodes![0].leaves![0].text, - type: "text", - }); - } - - parsedMessageTextContent += messageLine.nodes![0].leaves![0].text; - break; - } - - case "webhookMessage": { - embeds.push(...(messageLine.data as { embeds: APIEmbed[] }).embeds); - break; - } - } - } - - return { - embeds, - mentions, - parsedArr: parsedMessageArray, - parsedText: parsedMessageTextContent.trim(), - }; + const parsedMessageArray: parsedTextResponse[] = []; + let parsedMessageTextContent = ""; + const mentions: { + channels: string[]; + reactions: string[]; + roles: string[]; + users: string[]; + } = { + channels: [], + reactions: [], + roles: [], + users: [], + }; + const embeds: APIEmbed[] = []; + const messageLinesWithoutEmpty = data.document.nodes.filter((x) => + x.type === "webhookMessage" + ? ( + x.data as { + embeds: APIEmbed[]; + } + ).embeds.length > 0 + : true, + ); + + for (let index = 0; index < messageLinesWithoutEmpty.length; index++) { + const messageLine = data.document.nodes[index]; + if (index) parsedMessageTextContent += "\n"; + switch (messageLine.type) { + case "paragraph": { + for (const node of messageLine.nodes) { + switch (node.object) { + case "text": { + for (const leaf of node.leaves!) { + if (leaf.text) { + parsedMessageArray.push({ + content: leaf.text, + type: "text", + }); + } + + parsedMessageTextContent += leaf.text; + } + + break; + } + + case "inline": { + const castedDataNode = node.data as MessageDataNode; + const leaf = node.nodes?.[0].leaves?.[0]; + if (!leaf) break; + + switch (node.type) { + case "mention": { + switch (castedDataNode.mention?.type) { + case "person": { + mentions.users.push(castedDataNode.mention?.id as string); + parsedMessageArray.push({ + content: leaf.text, + mention: castedDataNode.mention, + type: "user", + }); + break; + } + + case "role": { + parsedMessageArray.push({ + content: leaf.text, + mention: castedDataNode.mention, + type: "role", + }); + mentions.roles.push(castedDataNode.mention?.id.toString()); + break; + } + } + + break; + } + + /* istanbul ignore next */ + case "reaction": { + mentions.reactions.push(castedDataNode.reaction?.id!); + parsedMessageArray.push({ + content: leaf.text, + reaction: castedDataNode.reaction, + type: "reaction", + }); + break; + } + + case "channel": { + mentions.channels.push(castedDataNode.channel?.id!); + parsedMessageArray.push({ + channel: castedDataNode.channel, + content: leaf.text, + type: "channel", + }); + break; + } + } + + parsedMessageTextContent += leaf.text; + break; + } + } + } + + break; + } + + /* istanbul ignore next */ + case "block-quote-container": { + for (const messageNodes of messageLine.nodes) { + for (const node of messageNodes.nodes!) { + switch (node.object) { + case "text": { + if (node.leaves?.[0].text) { + parsedMessageArray.push({ + content: node.leaves?.[0].text, + type: "text", + }); + } + + parsedMessageTextContent += node.leaves?.[0].text; + break; + } + + case "inline": { + const castedDataNode = node.data as MessageDataNode; + switch (node.type) { + case "mention": { + switch (castedDataNode.mention?.type) { + case "person": { + mentions.users.push(castedDataNode.mention?.id as string); + parsedMessageArray.push({ + content: node.nodes?.[0].leaves?.[0].text!, + mention: castedDataNode.mention, + type: "user", + }); + break; + } + + case "role": { + parsedMessageArray.push({ + content: node.nodes?.[0].leaves?.[0].text!, + mention: castedDataNode.mention, + type: "role", + }); + mentions.roles.push(castedDataNode.mention?.id.toString()); + break; + } + } + + break; + } + + case "reaction": { + mentions.reactions.push(castedDataNode.reaction?.id!); + parsedMessageArray.push({ + content: node.nodes?.[0].leaves?.[0].text!, + reaction: castedDataNode.reaction, + type: "reaction", + }); + break; + } + + case "channel": { + mentions.channels.push(castedDataNode.channel?.id!); + parsedMessageArray.push({ + channel: castedDataNode.channel, + content: node.nodes?.[0].leaves?.[0].text!, + type: "channel", + }); + break; + } + } + + parsedMessageTextContent += node.nodes?.[0].leaves?.[0].text; + break; + } + } + } + } + + break; + } + + case "markdown-plain-text": { + if (messageLine.nodes?.[0].leaves?.[0].text) { + parsedMessageArray.push({ + content: messageLine.nodes?.[0].leaves?.[0].text, + type: "text", + }); + } + + parsedMessageTextContent += messageLine.nodes?.[0].leaves?.[0].text; + break; + } + + case "webhookMessage": { + embeds.push( + ...( + messageLine.data as { + embeds: APIEmbed[]; + } + ).embeds, + ); + break; + } + } + } + + return { + embeds, + mentions, + parsedArr: parsedMessageArray, + parsedText: parsedMessageTextContent.trim(), + }; } /** @@ -267,15 +283,15 @@ export function parseMessage(data: APIContent): parsedMessage { * @internal */ export type parsedMessage = { - embeds: APIEmbed[]; - mentions: { - channels: string[]; - reactions: string[]; - roles: string[]; - users: string[]; - }; - parsedArr: parsedTextResponse[]; - parsedText: string; + embeds: APIEmbed[]; + mentions: { + channels: string[]; + reactions: string[]; + roles: string[]; + users: string[]; + }; + parsedArr: parsedTextResponse[]; + parsedText: string; }; /** @@ -284,23 +300,23 @@ export type parsedMessage = { * @internal */ export type MessageDataNode = { - channel?: { - id: string; - matcher: string; - name: string; - }; - mention?: { - avatar?: string; - color: string; - id: number | string; - matcher: string; - name: string; - nickname?: boolean; - type: string; - }; - reaction?: { - id: string; - }; + channel?: { + id: string; + matcher: string; + name: string; + }; + mention?: { + avatar?: string; + color: string; + id: number | string; + matcher: string; + name: string; + nickname?: boolean; + type: string; + }; + reaction?: { + id: string; + }; }; export type EmbedStructure = APIEmbed | WebhookEmbed; @@ -311,17 +327,17 @@ export type EmbedStructure = APIEmbed | WebhookEmbed; * @internal */ export type parsedTextResponse = { - channel?: unknown; - content: string; - mention?: unknown; - reaction?: unknown; - type: string; + channel?: unknown; + content: string; + mention?: unknown; + reaction?: unknown; + type: string; }; /** * The message structure of a string -> message object suitable to send to guilded */ export type enforcedMessageStructure = { - content: APIContent; - messageId: string; + content: APIContent; + messageId: string; }; diff --git a/packages/api/lib/rest/util/routes.ts b/packages/api/lib/rest/util/routes.ts index 09e3ce79..d965a3b6 100644 --- a/packages/api/lib/rest/util/routes.ts +++ b/packages/api/lib/rest/util/routes.ts @@ -2,80 +2,80 @@ import { WSPayload, WSSchema } from "../../generated/api-typings"; import type { SocialLinkPayload } from "../../generated/router"; export const ROUTES = { - // Channel Endpoints - channels: () => `/channels` as string, - channel: (channelId: string) => `/channels/${channelId}` as const, + // Channel Endpoints + channels: () => "/channels" as string, + channel: (channelId: string) => `/channels/${channelId}` as const, - // Channel Endpoints - channelMessages: (channelId: string) => `/channels/${channelId}/messages` as const, - channelMessage: (channelId: string, messageId: string) => `/channels/${channelId}/messages/${messageId}` as const, + // Channel Endpoints + channelMessages: (channelId: string) => `/channels/${channelId}/messages` as const, + channelMessage: (channelId: string, messageId: string) => `/channels/${channelId}/messages/${messageId}` as const, - // CalendarEvent Endpoints - calendarEvents: (channelId: string) => `/channels/${channelId}/events` as const, - calendarEvent: (channelId: string, calendarEventId: number) => `/channels/${channelId}/events/${calendarEventId}` as const, + // CalendarEvent Endpoints + calendarEvents: (channelId: string) => `/channels/${channelId}/events` as const, + calendarEvent: (channelId: string, calendarEventId: number) => `/channels/${channelId}/events/${calendarEventId}` as const, - // CalendarRsvp Endpoints - calendarEventRsvps: (channelId: string, calendarEventId: number) => `/channels/${channelId}/events/${calendarEventId}/rsvps` as const, - calendarEventRsvp: (channelId: string, calendarEventId: number, userId: string) => `/channels/${channelId}/events/${calendarEventId}/rsvps/${userId}` as const, + // CalendarRsvp Endpoints + calendarEventRsvps: (channelId: string, calendarEventId: number) => `/channels/${channelId}/events/${calendarEventId}/rsvps` as const, + calendarEventRsvp: (channelId: string, calendarEventId: number, userId: string) => `/channels/${channelId}/events/${calendarEventId}/rsvps/${userId}` as const, - calendarEventRsvpsMany: (channelId: string, calendarEventId: number) => `/channels/${channelId}/events/${calendarEventId}/rsvps` as const, + calendarEventRsvpsMany: (channelId: string, calendarEventId: number) => `/channels/${channelId}/events/${calendarEventId}/rsvps` as const, - // Server Endpoints - server: (serverId: string) => `/servers/${serverId}` as const, + // Server Endpoints + server: (serverId: string) => `/servers/${serverId}` as const, - // Member Endpoints - memberNickname: (serverId: string, userId: string) => `/servers/${serverId}/members/${userId}/nickname` as const, - memberRoles: (serverId: string, userId: string) => `/servers/${serverId}/members/${userId}/roles` as const, - member: (serverId: string, userId: string) => `/servers/${serverId}/members/${userId}` as const, - members: (serverId: string) => `/servers/${serverId}/members` as const, - memberBan: (serverId: string, userId: string) => `/servers/${serverId}/bans/${userId}` as const, - memberBans: (serverId: string) => `/servers/${serverId}/bans` as const, + // Member Endpoints + memberNickname: (serverId: string, userId: string) => `/servers/${serverId}/members/${userId}/nickname` as const, + memberRoles: (serverId: string, userId: string) => `/servers/${serverId}/members/${userId}/roles` as const, + member: (serverId: string, userId: string) => `/servers/${serverId}/members/${userId}` as const, + members: (serverId: string) => `/servers/${serverId}/members` as const, + memberBan: (serverId: string, userId: string) => `/servers/${serverId}/bans/${userId}` as const, + memberBans: (serverId: string) => `/servers/${serverId}/bans` as const, - // User Endpoints - user: (userId: string) => `/users/${userId}` as const, - me: () => `/users/@me` as const, + // User Endpoints + user: (userId: string) => `/users/${userId}` as const, + me: () => "/users/@me" as const, - // Forum Endpoints - forumTopics: (channelId: string) => `/channels/${channelId}/topics` as const, - forumTopic: (channelId: string, forumTopicId: string) => `/channels/${channelId}/topics/${forumTopicId}` as const, - forumTopicPin: (channelId: string, forumTopicId: string) => `/channels/${channelId}/topics/${forumTopicId}/pin` as const, - forumTopicLock: (channelId: string, forumTopicId: string) => `/channels/${channelId}/topics/${forumTopicId}/lock` as const, + // Forum Endpoints + forumTopics: (channelId: string) => `/channels/${channelId}/topics` as const, + forumTopic: (channelId: string, forumTopicId: string) => `/channels/${channelId}/topics/${forumTopicId}` as const, + forumTopicPin: (channelId: string, forumTopicId: string) => `/channels/${channelId}/topics/${forumTopicId}/pin` as const, + forumTopicLock: (channelId: string, forumTopicId: string) => `/channels/${channelId}/topics/${forumTopicId}/lock` as const, - // List Endpoints - listItems: (channelId: string) => `/channels/${channelId}/items` as const, - listItem: (channelId: string, itemId: string) => `/channels/${channelId}/items/${itemId}` as const, - listItemComplete: (channelId: string, itemId: string) => `/channels/${channelId}/items/${itemId}/complete` as const, + // List Endpoints + listItems: (channelId: string) => `/channels/${channelId}/items` as const, + listItem: (channelId: string, itemId: string) => `/channels/${channelId}/items/${itemId}` as const, + listItemComplete: (channelId: string, itemId: string) => `/channels/${channelId}/items/${itemId}/complete` as const, - // Docs Endpoints - channelDocs: (channelId: string) => `/channels/${channelId}/docs` as const, - channelDoc: (channelId: string, docId: number) => `/channels/${channelId}/docs/${docId}` as const, + // Docs Endpoints + channelDocs: (channelId: string) => `/channels/${channelId}/docs` as const, + channelDoc: (channelId: string, docId: number) => `/channels/${channelId}/docs/${docId}` as const, - // Reactions Endpoints - channelReaction: (channelId: string, contentId: string, emoteId: number) => `/channels/${channelId}/content/${contentId}/emotes/${emoteId}` as const, + // Reactions Endpoints + channelReaction: (channelId: string, contentId: string, emoteId: number) => `/channels/${channelId}/content/${contentId}/emotes/${emoteId}` as const, - // Server XP Endpoints - memberXP: (serverId: string, userId: string) => `/servers/${serverId}/members/${userId}/xp` as const, - roleXP: (serverId: string, roleId: string) => `/servers/${serverId}/roles/${roleId}/xp` as const, + // Server XP Endpoints + memberXP: (serverId: string, userId: string) => `/servers/${serverId}/members/${userId}/xp` as const, + roleXP: (serverId: string, roleId: string) => `/servers/${serverId}/roles/${roleId}/xp` as const, - // Social Links Endpoints - memberSocialLinks: (serverId: string, userId: string, type: SocialLinkPayload["type"]) => `/servers/${serverId}/members/${userId}/social-links/${type}` as const, + // Social Links Endpoints + memberSocialLinks: (serverId: string, userId: string, type: SocialLinkPayload["type"]) => `/servers/${serverId}/members/${userId}/social-links/${type}` as const, - // Group Memberships Endpoints - groupMember: (groupId: string, userId: string) => `/groups/${groupId}/members/${userId}` as const, + // Group Memberships Endpoints + groupMember: (groupId: string, userId: string) => `/groups/${groupId}/members/${userId}` as const, - // Role Memberships Endpoints - memberRole: (serverId: string, memberId: string, roleId: number) => `/servers/${serverId}/members/${memberId}/roles/${roleId}` as const, + // Role Memberships Endpoints + memberRole: (serverId: string, memberId: string, roleId: number) => `/servers/${serverId}/members/${memberId}/roles/${roleId}` as const, - // Webhook Endpoints - serverWebhooks: (serverId: string) => `/servers/${serverId}/webhooks`, - serverWebhook: (serverId: string, webhookId: string) => `/servers/${serverId}/webhooks/${webhookId}`, + // Webhook Endpoints + serverWebhooks: (serverId: string) => `/servers/${serverId}/webhooks`, + serverWebhook: (serverId: string, webhookId: string) => `/servers/${serverId}/webhooks/${webhookId}`, } as const; export const DOMAINS = { - AWS_CDN: "https://s3-us-west-2.amazonaws.com/www.guilded.gg/", - BASE_DOMAIN: "www.guilded.gg", - API_DOMAIN: "api.guilded.gg", - CDN: "img.guildedcdn.com", - IMAGE_CDN_DOMAIN: "img.guildedcdn.com", - MEDIA_DOMAIN: "media.guilded.gg", + AWS_CDN: "https://s3-us-west-2.amazonaws.com/www.guilded.gg/", + BASE_DOMAIN: "www.guilded.gg", + API_DOMAIN: "api.guilded.gg", + CDN: "img.guildedcdn.com", + IMAGE_CDN_DOMAIN: "img.guildedcdn.com", + MEDIA_DOMAIN: "media.guilded.gg", } as const; diff --git a/packages/api/lib/rest/webhook/WebhookClient.ts b/packages/api/lib/rest/webhook/WebhookClient.ts index 83275658..416af898 100644 --- a/packages/api/lib/rest/webhook/WebhookClient.ts +++ b/packages/api/lib/rest/webhook/WebhookClient.ts @@ -1,104 +1,121 @@ import FormData from "form-data"; import type { APIContent, APIEmbed, RESTPostWebhookBody, RESTPostWebhookResult } from "../../generated/api-typings"; import { RestManager } from "../RestManager"; -import { type parsedMessage, type MessageAttachment, type WebhookMessageContent, parseMessage, transformEmbedToAPIEmbed } from "../util/message"; +import { type MessageAttachment, type WebhookMessageContent, parseMessage, type parsedMessage, transformEmbedToAPIEmbed } from "../util/message"; import type { WebhookEmbed } from "./WebhookEmbed"; export class WebhookClient { - public URL: string; - - public id: string; - - public token: string; - - public username: string | null; - - public avatarURL: string | null; - - private readonly rest: RestManager; - - public constructor(webhookConnection: string | { id: string; token: string }, { username, avatarURL }: { avatarURL?: string; username?: string } = {}) { - if (!webhookConnection) { - throw new TypeError(`Must provide Webhook connection info in either string or object. Received ${webhookConnection}.`); - } - - if (typeof webhookConnection === "string") { - const destructuredWebhookURL = /guilded.gg\/webhooks\/(?[^/]+)\/(?[^/]+)/.exec(webhookConnection); - if (!destructuredWebhookURL?.length) { - throw new Error("Not a proper guilded webhook URL! Alternatively, you can provide an ID/token"); - } - - const [_, id, token] = destructuredWebhookURL; - this.id = id; - this.token = token; - } else if (webhookConnection.id && webhookConnection.token) { - this.id = webhookConnection.id; - this.token = webhookConnection.token; - } else { - throw new TypeError("You must provide either a webhook URL or a webhook ID & token in an object when constructing the Webhook Client"); - } - - this.URL = `https://media.guilded.gg/webhooks/${this.id}/${this.token}`; - this.rest = new RestManager({ proxyURL: this.URL, token: this.token }); - this.username = username ?? null; - this.avatarURL = avatarURL ?? null; - } - - public async send( - content: WebhookMessageContent, - embeds?: (APIEmbed | WebhookEmbed)[], - options?: { - avatarURL?: string; - files?: MessageAttachment[]; - username?: string; - }, - ): Promise { - const contentIsObject = typeof content === "object"; - const resEmbeds = transformEmbedToAPIEmbed((contentIsObject ? content.embeds : embeds) ?? []); - const resFiles = contentIsObject ? content.files : options?.files; - - const baseBody: RESTPostWebhookBody = contentIsObject - ? { - ...content, - embeds: resEmbeds, - } - : { - content, - embeds: resEmbeds, - username: options?.username ?? this.username ?? undefined, - avatar_url: options?.avatarURL ?? this.avatarURL ?? undefined, - }; - - let body: FormData | RESTPostWebhookBody = baseBody; - const formData = new FormData(); - if (resFiles?.length) { - for (const [index, value] of resFiles.entries()) { - formData.append(`files[${index}]`, value.content, { - filename: value.name, - filepath: value.path, - }); - } - - formData.append("payload_json", JSON.stringify(baseBody), { - contentType: "application/json", - }); - body = formData; - } - - const data = await this.rest.post("", body); - const parsedContent = parseMessage(data.content); - - return { - ...data, - content: parsedContent.parsedText, - parsedContent, - rawContent: data.content, - } as WebhookExecuteResponse; - } + public URL: string; + + public id: string; + + public token: string; + + public username: string | null; + + public avatarURL: string | null; + + private readonly rest: RestManager; + + public constructor( + webhookConnection: + | string + | { + id: string; + token: string; + }, + { + username, + avatarURL, + }: { + avatarURL?: string; + username?: string; + } = {}, + ) { + if (!webhookConnection) { + throw new TypeError(`Must provide Webhook connection info in either string or object. Received ${webhookConnection}.`); + } + + if (typeof webhookConnection === "string") { + const destructuredWebhookURL = /guilded.gg\/webhooks\/(?[^/]+)\/(?[^/]+)/.exec(webhookConnection); + if (!destructuredWebhookURL?.length) { + throw new Error("Not a proper guilded webhook URL! Alternatively, you can provide an ID/token"); + } + + const [_, id, token] = destructuredWebhookURL; + this.id = id; + this.token = token; + } else if (webhookConnection.id && webhookConnection.token) { + this.id = webhookConnection.id; + this.token = webhookConnection.token; + } else { + throw new TypeError("You must provide either a webhook URL or a webhook ID & token in an object when constructing the Webhook Client"); + } + + this.URL = `https://media.guilded.gg/webhooks/${this.id}/${this.token}`; + this.rest = new RestManager({ + proxyURL: this.URL, + token: this.token, + }); + this.username = username ?? null; + this.avatarURL = avatarURL ?? null; + } + + public async send( + content: WebhookMessageContent, + embeds?: (APIEmbed | WebhookEmbed)[], + options?: { + avatarURL?: string; + files?: MessageAttachment[]; + username?: string; + }, + ): Promise { + const contentIsObject = typeof content === "object"; + const resEmbeds = transformEmbedToAPIEmbed((contentIsObject ? content.embeds : embeds) ?? []); + const resFiles = contentIsObject ? content.files : options?.files; + + const baseBody: RESTPostWebhookBody = contentIsObject + ? { + ...content, + embeds: resEmbeds, + } + : { + content, + embeds: resEmbeds, + username: options?.username ?? this.username ?? undefined, + avatar_url: options?.avatarURL ?? this.avatarURL ?? undefined, + }; + + let body: FormData | RESTPostWebhookBody = baseBody; + const formData = new FormData(); + if (resFiles?.length) { + for (const [index, value] of resFiles.entries()) { + formData.append(`files[${index}]`, value.content, { + filename: value.name, + filepath: value.path, + }); + } + + formData.append("payload_json", JSON.stringify(baseBody), { + contentType: "application/json", + }); + body = formData; + } + + const data = await this.rest.post("", body); + const parsedContent = parseMessage(data.content); + + return { + ...data, + content: parsedContent.parsedText, + parsedContent, + rawContent: data.content, + } as WebhookExecuteResponse; + } } export type WebhookExecuteResponse = Omit & { - content: string; - parsedContent: parsedMessage; - rawContent: APIContent; + content: string; + parsedContent: parsedMessage; + rawContent: APIContent; }; diff --git a/packages/api/lib/rest/webhook/WebhookEmbed.ts b/packages/api/lib/rest/webhook/WebhookEmbed.ts index c137b736..6365d49e 100644 --- a/packages/api/lib/rest/webhook/WebhookEmbed.ts +++ b/packages/api/lib/rest/webhook/WebhookEmbed.ts @@ -2,302 +2,326 @@ import type { APIEmbed } from "../../generated/api-typings"; import { resolveColor } from "../util/color"; export class WebhookEmbed { - public title: string | null; + public title: string | null; - public description: string | null; - - public url: string | null; + public description: string | null; + + public url: string | null; - public timestamp: number | null; - - public timestampString: string | null; - - public color: number | null; - - public footer: { - iconURL: string | null; - proxyIconURL: string | null; - text: string; - } | null; - - public image: APIWebhookEmbedMediaData | null; - - public thumbnail: APIWebhookEmbedMediaData | null; - - public video: APIWebhookEmbedMediaData | null; - - public provider: { - name: string | null; - url: string | null; - } | null; - - public author: { - iconURL: string | null; - name: string | null; - proxyIconURL: string | null; - url: string | null; - } | null; - - public fields: { - inline: boolean | null; - name: string; - value: string; - }[]; - - public constructor(data?: Partial) { - this.footer = null; - this.image = null; - this.thumbnail = null; - this.author = null; - this.fields = []; - this.video = null; - this.provider = null; - this.color = null; - this.timestamp = null; - this.timestampString = null; - this.description = null; - this.url = null; - this.title = null; - - if (data) this.update(data); - } - - /* istanbul ignore next */ - public update(data: Partial): void { - if ("color" in data && data.color !== undefined) { - this.setColor(data.color); - } - - if ("timestamp" in data && data.timestamp !== undefined) { - this.setTimestamp(data.timestamp); - } - - if ("title" in data && data.title !== undefined) { - this.setTitle(data.title); - } - - if ("description" in data && data.description !== undefined) { - this.setDescription(data.description); - } - - if ("url" in data && data.url !== undefined) { - this.setURL(data.url); - } - - if ("provider" in data && data.provider !== undefined) { - this.setProvider(data.provider.name, data.provider.url); - } - - if ("footer" in data && data.footer !== undefined) { - this.setFooter(data.footer.text, data.footer.icon_url, data.footer.proxy_icon_url); - } - - if ("image" in data && data.image !== undefined) { - this.setImage(data.image.url, data.image.height, data.image.width, data.image.proxy_url); - } - - if ("thumbnail" in data && data.thumbnail !== undefined) { - this.setThumbnail(data.thumbnail.url, data.thumbnail.height, data.thumbnail.width, data.thumbnail.proxy_url); - } - - if ("author" in data && data.author !== undefined) { - this.setAuthor(data.author.name, data.author.icon_url, data.author.url, data.author.proxy_icon_url); - } - - if ("fields" in data && data.fields !== undefined) { - this.addFields(data.fields); - } - - if ("video" in data && data.video !== undefined) { - this.setVideo(data.video.url, data.video.height, data.video.width, data.video.proxy_url); - } - } - - public setTitle(title?: string | null): this { - this.title = title ?? null; - return this; - } - - public setDescription(description?: string | null): this { - this.description = description ?? null; - return this; - } - - public setURL(url?: string | null): this { - this.url = url ?? null; - return this; - } - - public setTimestamp(timestamp?: Date | number | string | null): this { - if (timestamp === null) { - this.timestamp = null; - this.timestampString = null; - return this; - } - - if (!timestamp) { - return this.setTimestamp(new Date()); - } - - const parsedTimestamp = timestamp instanceof Date ? timestamp : Number.isInteger(timestamp) || typeof timestamp === "string" ? new Date(timestamp) : null; - if (!parsedTimestamp || (parsedTimestamp instanceof Date && Number.isNaN(parsedTimestamp.getTime()))) { - throw new TypeError("Invalid DateResolvable passed into setTimestamp."); - } - - this.timestamp = parsedTimestamp.getTime(); - this.timestampString = parsedTimestamp.toISOString(); - return this; - } - - public setColor(color?: number | string | [number, number, number] | null): this { - this.color = color ? resolveColor(color) : null; - return this; - } - - public setFooter(text?: string, iconURL?: string | null, proxyIconURL?: string | null): this { - this.footer = text ? { iconURL: iconURL ?? null, proxyIconURL: proxyIconURL ?? null, text } : null; - return this; - } - - public setImage(url?: string, height?: string | null, width?: string | null, proxyURL?: string | null): this { - this.image = url - ? { - height: height ?? null, - proxyURL: proxyURL ?? null, - url, - width: width ?? null, - } - : null; - return this; - } - - public setThumbnail(url?: string, height?: string | null, width?: string | null, proxyURL?: string | null): this { - this.thumbnail = url - ? { - height: height ?? null, - proxyURL: proxyURL ?? null, - url, - width: width ?? null, - } - : null; - return this; - } - - public setVideo(url?: string, height?: string | null, width?: string | null, proxyURL?: string | null): this { - this.video = url - ? { - height: height ?? null, - proxyURL: proxyURL ?? null, - url, - width: width ?? null, - } - : null; - return this; - } - - public setProvider(name?: string | null, url?: string | null): this { - this.provider = name && url ? { name: name ?? null, url: url ?? null } : null; - return this; - } - - public setAuthor(name?: string, iconURL?: string | null, url?: string | null, proxyIconURL?: string | null): this { - this.author = name - ? { - iconURL: iconURL ?? null, - name: name ?? null, - proxyIconURL: proxyIconURL ?? null, - url: url ?? null, - } - : null; - return this; - } - - public addFields(fields: { inline?: boolean; name: string; value: string }[]): this { - this.fields.push( - ...fields.map((field) => ({ - inline: field.inline ?? false, - name: field.name, - value: field.value, - })), - ); - return this; - } - - public addField(name: string, value: string, inline?: boolean): this { - this.addFields([{ inline, name, value }]); - return this; - } - - public clearFields(): this { - this.fields.length = 0; - return this; - } - - public toJSON(): APIEmbed { - return { - author: this.author?.name - ? { - icon_url: this.author.iconURL ?? undefined, - name: this.author.name, - proxy_icon_url: this.author.proxyIconURL ?? undefined, - url: this.author.url ?? undefined, - } - : undefined, - color: this.color ?? undefined, - description: this.description ?? undefined, - fields: - this.fields.map((field) => ({ - inline: field.inline ?? false, - name: field.name, - value: field.value, - })) ?? undefined, - footer: this.footer - ? { - icon_url: this.footer.iconURL ?? undefined, - proxy_icon_url: this.footer.proxyIconURL ?? undefined, - text: this.footer.text ?? undefined, - } - : undefined, - image: this.image - ? { - height: this.image.height ?? undefined, - proxy_url: this.image.proxyURL ?? undefined, - url: this.image.url ?? undefined, - width: this.image.width ?? undefined, - } - : undefined, - provider: this.provider - ? { - name: this.provider.name ?? undefined, - url: this.provider.url ?? undefined, - } - : undefined, - thumbnail: this.thumbnail - ? { - height: this.thumbnail.height ?? undefined, - proxy_url: this.thumbnail.proxyURL ?? undefined, - url: this.thumbnail.url ?? undefined, - width: this.thumbnail.width ?? undefined, - } - : undefined, - timestamp: this.timestampString ?? undefined, - title: this.title ?? undefined, - url: this.url ?? undefined, - video: this.video - ? { - height: this.video.height ?? undefined, - proxy_url: this.video.proxyURL ?? undefined, - url: this.video.url ?? undefined, - width: this.video.width ?? undefined, - } - : undefined, - }; - } + public timestamp: number | null; + + public timestampString: string | null; + + public color: number | null; + + public footer: { + iconURL: string | null; + proxyIconURL: string | null; + text: string; + } | null; + + public image: APIWebhookEmbedMediaData | null; + + public thumbnail: APIWebhookEmbedMediaData | null; + + public video: APIWebhookEmbedMediaData | null; + + public provider: { + name: string | null; + url: string | null; + } | null; + + public author: { + iconURL: string | null; + name: string | null; + proxyIconURL: string | null; + url: string | null; + } | null; + + public fields: { + inline: boolean | null; + name: string; + value: string; + }[]; + + public constructor(data?: Partial) { + this.footer = null; + this.image = null; + this.thumbnail = null; + this.author = null; + this.fields = []; + this.video = null; + this.provider = null; + this.color = null; + this.timestamp = null; + this.timestampString = null; + this.description = null; + this.url = null; + this.title = null; + + if (data) this.update(data); + } + + /* istanbul ignore next */ + public update(data: Partial): void { + if ("color" in data && data.color !== undefined) { + this.setColor(data.color); + } + + if ("timestamp" in data && data.timestamp !== undefined) { + this.setTimestamp(data.timestamp); + } + + if ("title" in data && data.title !== undefined) { + this.setTitle(data.title); + } + + if ("description" in data && data.description !== undefined) { + this.setDescription(data.description); + } + + if ("url" in data && data.url !== undefined) { + this.setURL(data.url); + } + + if ("provider" in data && data.provider !== undefined) { + this.setProvider(data.provider.name, data.provider.url); + } + + if ("footer" in data && data.footer !== undefined) { + this.setFooter(data.footer.text, data.footer.icon_url, data.footer.proxy_icon_url); + } + + if ("image" in data && data.image !== undefined) { + this.setImage(data.image.url, data.image.height, data.image.width, data.image.proxy_url); + } + + if ("thumbnail" in data && data.thumbnail !== undefined) { + this.setThumbnail(data.thumbnail.url, data.thumbnail.height, data.thumbnail.width, data.thumbnail.proxy_url); + } + + if ("author" in data && data.author !== undefined) { + this.setAuthor(data.author.name, data.author.icon_url, data.author.url, data.author.proxy_icon_url); + } + + if ("fields" in data && data.fields !== undefined) { + this.addFields(data.fields); + } + + if ("video" in data && data.video !== undefined) { + this.setVideo(data.video.url, data.video.height, data.video.width, data.video.proxy_url); + } + } + + public setTitle(title?: string | null): this { + this.title = title ?? null; + return this; + } + + public setDescription(description?: string | null): this { + this.description = description ?? null; + return this; + } + + public setURL(url?: string | null): this { + this.url = url ?? null; + return this; + } + + public setTimestamp(timestamp?: Date | number | string | null): this { + if (timestamp === null) { + this.timestamp = null; + this.timestampString = null; + return this; + } + + if (!timestamp) { + return this.setTimestamp(new Date()); + } + + const parsedTimestamp = timestamp instanceof Date ? timestamp : Number.isInteger(timestamp) || typeof timestamp === "string" ? new Date(timestamp) : null; + if (!parsedTimestamp || (parsedTimestamp instanceof Date && Number.isNaN(parsedTimestamp.getTime()))) { + throw new TypeError("Invalid DateResolvable passed into setTimestamp."); + } + + this.timestamp = parsedTimestamp.getTime(); + this.timestampString = parsedTimestamp.toISOString(); + return this; + } + + public setColor(color?: number | string | [number, number, number] | null): this { + this.color = color ? resolveColor(color) : null; + return this; + } + + public setFooter(text?: string, iconURL?: string | null, proxyIconURL?: string | null): this { + this.footer = text + ? { + iconURL: iconURL ?? null, + proxyIconURL: proxyIconURL ?? null, + text, + } + : null; + return this; + } + + public setImage(url?: string, height?: string | null, width?: string | null, proxyURL?: string | null): this { + this.image = url + ? { + height: height ?? null, + proxyURL: proxyURL ?? null, + url, + width: width ?? null, + } + : null; + return this; + } + + public setThumbnail(url?: string, height?: string | null, width?: string | null, proxyURL?: string | null): this { + this.thumbnail = url + ? { + height: height ?? null, + proxyURL: proxyURL ?? null, + url, + width: width ?? null, + } + : null; + return this; + } + + public setVideo(url?: string, height?: string | null, width?: string | null, proxyURL?: string | null): this { + this.video = url + ? { + height: height ?? null, + proxyURL: proxyURL ?? null, + url, + width: width ?? null, + } + : null; + return this; + } + + public setProvider(name?: string | null, url?: string | null): this { + this.provider = + name && url + ? { + name: name ?? null, + url: url ?? null, + } + : null; + return this; + } + + public setAuthor(name?: string, iconURL?: string | null, url?: string | null, proxyIconURL?: string | null): this { + this.author = name + ? { + iconURL: iconURL ?? null, + name: name ?? null, + proxyIconURL: proxyIconURL ?? null, + url: url ?? null, + } + : null; + return this; + } + + public addFields( + fields: { + inline?: boolean; + name: string; + value: string; + }[], + ): this { + this.fields.push( + ...fields.map((field) => ({ + inline: field.inline ?? false, + name: field.name, + value: field.value, + })), + ); + return this; + } + + public addField(name: string, value: string, inline?: boolean): this { + this.addFields([ + { + inline, + name, + value, + }, + ]); + return this; + } + + public clearFields(): this { + this.fields.length = 0; + return this; + } + + public toJSON(): APIEmbed { + return { + author: this.author?.name + ? { + icon_url: this.author.iconURL ?? undefined, + name: this.author.name, + proxy_icon_url: this.author.proxyIconURL ?? undefined, + url: this.author.url ?? undefined, + } + : undefined, + color: this.color ?? undefined, + description: this.description ?? undefined, + fields: + this.fields.map((field) => ({ + inline: field.inline ?? false, + name: field.name, + value: field.value, + })) ?? undefined, + footer: this.footer + ? { + icon_url: this.footer.iconURL ?? undefined, + proxy_icon_url: this.footer.proxyIconURL ?? undefined, + text: this.footer.text ?? undefined, + } + : undefined, + image: this.image + ? { + height: this.image.height ?? undefined, + proxy_url: this.image.proxyURL ?? undefined, + url: this.image.url ?? undefined, + width: this.image.width ?? undefined, + } + : undefined, + provider: this.provider + ? { + name: this.provider.name ?? undefined, + url: this.provider.url ?? undefined, + } + : undefined, + thumbnail: this.thumbnail + ? { + height: this.thumbnail.height ?? undefined, + proxy_url: this.thumbnail.proxyURL ?? undefined, + url: this.thumbnail.url ?? undefined, + width: this.thumbnail.width ?? undefined, + } + : undefined, + timestamp: this.timestampString ?? undefined, + title: this.title ?? undefined, + url: this.url ?? undefined, + video: this.video + ? { + height: this.video.height ?? undefined, + proxy_url: this.video.proxyURL ?? undefined, + url: this.video.url ?? undefined, + width: this.video.width ?? undefined, + } + : undefined, + }; + } } export type APIWebhookEmbedMediaData = { - height: string | null; - proxyURL: string | null; - url: string; - width: string | null; + height: string | null; + proxyURL: string | null; + url: string; + width: string | null; }; diff --git a/packages/api/lib/ws/Heartbeater.ts b/packages/api/lib/ws/Heartbeater.ts index d0274bed..abdbf6c3 100644 --- a/packages/api/lib/ws/Heartbeater.ts +++ b/packages/api/lib/ws/Heartbeater.ts @@ -1,18 +1,21 @@ import type { WebSocketManager } from "./WebSocketManager"; export default class Heartbeater { - public heartbeatInterval: NodeJS.Timeout; + public heartbeatInterval: NodeJS.Timeout; - public constructor(public readonly ws: WebSocketManager, public heartbeatIntervalMs: number) { - this.heartbeatInterval = setInterval(() => { - this.ws._debug("Sending heartbeat to Guilded."); - this.ws.lastPingedAt = Date.now(); - this.ws.socket?.ping(); - }, this.heartbeatIntervalMs); - } + public constructor( + public readonly ws: WebSocketManager, + public heartbeatIntervalMs: number, + ) { + this.heartbeatInterval = setInterval(() => { + this.ws._debug("Sending heartbeat to Guilded."); + this.ws.lastPingedAt = Date.now(); + this.ws.socket?.ping(); + }, this.heartbeatIntervalMs); + } - public destroy(): void { - clearInterval(this.heartbeatInterval); - this.ws.lastPingedAt = -1; - } + public destroy(): void { + clearInterval(this.heartbeatInterval); + this.ws.lastPingedAt = -1; + } } diff --git a/packages/api/lib/ws/WebSocketManager.ts b/packages/api/lib/ws/WebSocketManager.ts index c5d4097c..1fe69e99 100644 --- a/packages/api/lib/ws/WebSocketManager.ts +++ b/packages/api/lib/ws/WebSocketManager.ts @@ -7,282 +7,301 @@ import { WSOpCodes } from "../generated/api-typings"; import Heartbeater from "./Heartbeater"; export class WebSocketManager { - /** - * The version of the websocket to connect to. - */ - version = this.options.version ?? 1; - - /** - * Token used to authenticate requests. - */ - token = this.options.token; - - /** - * The websocket connected to guilded. - */ - socket: WebSocket | null = null; - - /** - * Whether or not this connection is connected and heartbeating. - */ - isAlive = false; - - /** - * The amount of milliseconds the websocket took to respond to the last ping request. This will be zero before the first heartbeat - */ - ping = 0; - - /** - * The timestamp in milliseconds of the last ping request. - */ - lastPingedAt = 0; - - /** - * The last message id received. Used in the event of resuming connections. - */ - lastMessageId: string | null = null; - - /** - * The date since the last initial connection was established. - */ - connectedAt: Date | null = null; - - /** - * Emitter in charge of emitting ws gateway related events - */ - emitter = new EventEmitter() as TypedEmitter; - - /** - * Count of how many times a reconnect has been attempted - */ - reconnectAttemptAmount = 0; - - /** - * Heartbeating helper - */ - heartbeater: Heartbeater | null = null; - - constructor(public readonly options: WebSocketOptions) {} - - /** - * The url that will be used to connect. Prioritizes proxy url and if not available uses the default base url for guidled. - */ - get wsURL(): string { - return this.options.proxyURL ?? `wss://www.guilded.gg/websocket/v${this.version}`; - } - - get reconnectAttemptExceeded(): boolean { - return this.reconnectAttemptAmount >= (this.options.reconnectAttemptLimit ?? Number.POSITIVE_INFINITY); - } - - get shouldReplayMissedEvents(): boolean { - return this.options.replayMissedEvents !== false; - } - - get shouldRequestMissedEvents(): boolean { - return this.shouldReplayMissedEvents && this.lastMessageId !== null; - } - - connect(): void { - this._debug(`Connecting to Guilded WS Gateway at url ${this.wsURL}.`); - const headers: Record = { - Authorization: `Bearer ${this.token}`, - }; - - if (this.shouldRequestMissedEvents) { - this._debug(`Requesting missed events from last message ${this.lastMessageId}.`); - if (this.lastMessageId) { - headers["guilded-last-message-id"] = this.lastMessageId; - } - } - - try { - this.socket = new WebSocket(this.wsURL, { - headers, - }); - this._debug("Socket created."); - } catch (error) { - this._debug(`Error creating socket ${(error as Error).message}.`); - if (!this.shouldRequestMissedEvents && this.lastMessageId) throw error; - - this.lastMessageId = null; - if (error instanceof Error) { - this.emitter.emit("error", "Error connecting to socket", error); - } - - this._handleDisconnect({ blockReconnects: false }); - return; - } - - this.socket.on("open", this.onSocketOpen.bind(this)); - this.socket.on("ping", this.onSocketPing.bind(this)); - this.socket.on("pong", this.onSocketPong.bind(this)); - this.socket.on("message", (data) => { - this.emitter.emit("raw", data); - this.onSocketMessage(data.toString()); - }); - - this.socket.on("error", (err) => { - this._debug(`Error received from WS. ${err.message}`); - this.emitter.emit("exit", "Gateway connection closed due to error."); - this._handleDisconnect({ blockReconnects: true }); - }); - - this.socket.on("close", (code, reason) => { - this.emitter.emit("exit", "Gateway connection closed."); - this._handleDisconnect({ blockReconnects: false }); - }); - } - - destroy(): void { - this._debug("Destroying websocket connection."); - if (!this.socket) { - throw new Error("There is no active connection to destroy."); - } - - this.heartbeater?.destroy(); - this.heartbeater = null; - - this.socket.removeAllListeners(); - if (!this.socket.CLOSED && !this.socket.CLOSING) this.socket.close(); - - this.socket = null; - this.isAlive = false; - } - - _handleDisconnect(opts: { blockReconnects: boolean }): void { - this._debug(`Received request to disconnect.`); - this.destroy(); - this._debug( - `Checking if should reconnect. + /** + * The version of the websocket to connect to. + */ + version = this.options.version ?? 1; + + /** + * Token used to authenticate requests. + */ + token = this.options.token; + + /** + * The websocket connected to guilded. + */ + socket: WebSocket | null = null; + + /** + * Whether or not this connection is connected and heartbeating. + */ + isAlive = false; + + /** + * The amount of milliseconds the websocket took to respond to the last ping request. This will be zero before the first heartbeat + */ + ping = 0; + + /** + * The timestamp in milliseconds of the last ping request. + */ + lastPingedAt = 0; + + /** + * The last message id received. Used in the event of resuming connections. + */ + lastMessageId: string | null = null; + + /** + * The date since the last initial connection was established. + */ + connectedAt: Date | null = null; + + /** + * Emitter in charge of emitting ws gateway related events + */ + emitter = new EventEmitter() as TypedEmitter; + + /** + * Count of how many times a reconnect has been attempted + */ + reconnectAttemptAmount = 0; + + /** + * Heartbeating helper + */ + heartbeater: Heartbeater | null = null; + + constructor(public readonly options: WebSocketOptions) {} + + /** + * The url that will be used to connect. Prioritizes proxy url and if not available uses the default base url for guidled. + */ + get wsURL(): string { + return this.options.proxyURL ?? `wss://www.guilded.gg/websocket/v${this.version}`; + } + + get reconnectAttemptExceeded(): boolean { + return this.reconnectAttemptAmount >= (this.options.reconnectAttemptLimit ?? Number.POSITIVE_INFINITY); + } + + get shouldReplayMissedEvents(): boolean { + return this.options.replayMissedEvents !== false; + } + + get shouldRequestMissedEvents(): boolean { + return this.shouldReplayMissedEvents && this.lastMessageId !== null; + } + + connect(): void { + this._debug(`Connecting to Guilded WS Gateway at url ${this.wsURL}.`); + const headers: Record = { + Authorization: `Bearer ${this.token}`, + }; + + if (this.shouldRequestMissedEvents) { + this._debug(`Requesting missed events from last message ${this.lastMessageId}.`); + if (this.lastMessageId) { + headers["guilded-last-message-id"] = this.lastMessageId; + } + } + + try { + this.socket = new WebSocket(this.wsURL, { + headers, + }); + this._debug("Socket created."); + } catch (error) { + this._debug(`Error creating socket ${(error as Error).message}.`); + if (!this.shouldRequestMissedEvents && this.lastMessageId) throw error; + + this.lastMessageId = null; + if (error instanceof Error) { + this.emitter.emit("error", "Error connecting to socket", error); + } + + this._handleDisconnect({ + blockReconnects: false, + }); + return; + } + + this.socket.on("open", this.onSocketOpen.bind(this)); + this.socket.on("ping", this.onSocketPing.bind(this)); + this.socket.on("pong", this.onSocketPong.bind(this)); + this.socket.on("message", (data) => { + this.emitter.emit("raw", data); + this.onSocketMessage(data.toString()); + }); + + this.socket.on("error", (err) => { + this._debug(`Error received from WS. ${err.message}`); + this.emitter.emit("exit", "Gateway connection closed due to error."); + this._handleDisconnect({ + blockReconnects: true, + }); + }); + + this.socket.on("close", (code, reason) => { + this.emitter.emit("exit", "Gateway connection closed."); + this._handleDisconnect({ + blockReconnects: false, + }); + }); + } + + destroy(): void { + this._debug("Destroying websocket connection."); + if (!this.socket) { + throw new Error("There is no active connection to destroy."); + } + + this.heartbeater?.destroy(); + this.heartbeater = null; + + this.socket.removeAllListeners(); + if (!this.socket.CLOSED && !this.socket.CLOSING) this.socket.close(); + + this.socket = null; + this.isAlive = false; + } + + _handleDisconnect(opts: { + blockReconnects: boolean; + }): void { + this._debug("Received request to disconnect."); + this.destroy(); + this._debug( + `Checking if should reconnect. Reconnect allowed: ${this.options.autoConnectOnErr}. Reconnect attempt ${this.reconnectAttemptAmount}. Reconnect attempt limit ${this.options.reconnectAttemptLimit}.`, - ); - if ((!opts.blockReconnects && (this.options.autoConnectOnErr ?? true)) || !this.reconnectAttemptExceeded) { - this._debug("Reconnecting."); - this.reconnectAttemptAmount++; - this.connect(); - } - } - - _debug(str: any): boolean { - return this.emitter.emit("debug", `[DEBUG] ${str}`); - } - - private onSocketMessage(packet: string): void { - let EVENT_NAME; - let EVENT_DATA; - - try { - const data = JSON.parse(packet) as SkeletonWSPayload; - EVENT_NAME = data.t; - EVENT_DATA = data; - } catch (error) { - this.emitter.emit("error", "ERROR PARSING WS EVENT", error as Error, packet); - return void 0; - } - - this._debug(`Received event ${EVENT_NAME}. ${packet}}`); - // SAVE THE ID IF AVAILABLE. USED FOR RESUMING CONNECTIONS. - if (EVENT_DATA.s) this.lastMessageId = EVENT_DATA.s; - - switch (EVENT_DATA.op) { - // Normal event based packets - case WSOpCodes.SUCCESS: { - this.emitter.emit("gatewayEvent", EVENT_NAME as WSEventNames, EVENT_DATA); - break; - } - - // Auto handled by ws lib - case WSOpCodes.WELCOME: { - this._debug("Received welcome packet. Setting up heartbeat."); - this.heartbeater = new Heartbeater(this, (EVENT_DATA.d as WSPayload<"_WelcomeMessage">).heartbeatIntervalMs); - this.emitter.emit("ready", (EVENT_DATA.d as WSPayload<"_WelcomeMessage">).user as ClientUserData); - break; - } - - case WSOpCodes.RESUME: { - this._debug("Received resume packet."); - this.lastMessageId = null; - break; - } - - case WSOpCodes.ERROR: { - this._debug("Received error packet."); - this.emitter.emit("error", "Error received from WS", new Error((EVENT_DATA.d as { message: string }).message)); - this.lastMessageId = null; - this._handleDisconnect({ - blockReconnects: false, - }); - break; - } - - default: { - this._debug("Received unknown opcode."); - this.emitter.emit("unknown", "unknown opcode", packet); - break; - } - } - } - - private onSocketOpen(): void { - this._debug("Socket has been successfully opened and is ready to receive data."); - this.isAlive = true; - this.connectedAt = new Date(); - } - - private onSocketPing(): void { - this._debug(`Ping request from Guilded received. Responding with a pong.`); - this.socket!.pong(); - } - - private onSocketPong(): void { - this.ping = Date.now() - this.lastPingedAt; - this._debug(`Pong response from Guilded received. Latency: ${this.ping}ms.`); - } + ); + if ((!opts.blockReconnects && (this.options.autoConnectOnErr ?? true)) || !this.reconnectAttemptExceeded) { + this._debug("Reconnecting."); + this.reconnectAttemptAmount++; + this.connect(); + } + } + + _debug(str: unknown): boolean { + return this.emitter.emit("debug", `[DEBUG] ${str}`); + } + + private onSocketMessage(packet: string): void { + let EVENT_NAME: string; + // biome-ignore lint/suspicious/noExplicitAny: Data can be anything json parseable + let EVENT_DATA: any; + + try { + const data = JSON.parse(packet) as SkeletonWSPayload; + EVENT_NAME = data.t; + EVENT_DATA = data; + } catch (error) { + this.emitter.emit("error", "ERROR PARSING WS EVENT", error as Error, packet); + return; + } + + this._debug(`Received event ${EVENT_NAME}. ${packet}}`); + // SAVE THE ID IF AVAILABLE. USED FOR RESUMING CONNECTIONS. + if (EVENT_DATA.s) this.lastMessageId = EVENT_DATA.s; + + switch (EVENT_DATA.op) { + // Normal event based packets + case WSOpCodes.SUCCESS: { + this.emitter.emit("gatewayEvent", EVENT_NAME as WSEventNames, EVENT_DATA); + break; + } + + // Auto handled by ws lib + case WSOpCodes.WELCOME: { + this._debug("Received welcome packet. Setting up heartbeat."); + this.heartbeater = new Heartbeater(this, (EVENT_DATA.d as WSPayload<"_WelcomeMessage">).heartbeatIntervalMs); + this.emitter.emit("ready", (EVENT_DATA.d as WSPayload<"_WelcomeMessage">).user as ClientUserData); + break; + } + + case WSOpCodes.RESUME: { + this._debug("Received resume packet."); + this.lastMessageId = null; + break; + } + + case WSOpCodes.ERROR: { + this._debug("Received error packet."); + this.emitter.emit( + "error", + "Error received from WS", + new Error( + ( + EVENT_DATA.d as { + message: string; + } + ).message, + ), + ); + this.lastMessageId = null; + this._handleDisconnect({ + blockReconnects: false, + }); + break; + } + + default: { + this._debug("Received unknown opcode."); + this.emitter.emit("unknown", "unknown opcode", packet); + break; + } + } + } + + private onSocketOpen(): void { + this._debug("Socket has been successfully opened and is ready to receive data."); + this.isAlive = true; + this.connectedAt = new Date(); + } + + private onSocketPing(): void { + this._debug("Ping request from Guilded received. Responding with a pong."); + this.socket?.pong(); + } + + private onSocketPong(): void { + this.ping = Date.now() - this.lastPingedAt; + this._debug(`Pong response from Guilded received. Latency: ${this.ping}ms.`); + } } export type WebSocketOptions = { - /** - * Whether to try to re-establish connection on error - */ - autoConnectOnErr?: boolean; - /** - * The base url that the websocket will connect to. - */ - proxyURL?: string; - /** - * Limit of how many times a reconnection should be attempted - */ - reconnectAttemptLimit?: number; - /** - * Whether the manager should request missed events on reconnect - */ - replayMissedEvents?: boolean; - /** - * The bot's token. - */ - token: string; - /** - * The version of the websocket to connect to. - */ - version?: 1; + /** + * Whether to try to re-establish connection on error + */ + autoConnectOnErr?: boolean; + /** + * The base url that the websocket will connect to. + */ + proxyURL?: string; + /** + * Limit of how many times a reconnection should be attempted + */ + reconnectAttemptLimit?: number; + /** + * Whether the manager should request missed events on reconnect + */ + replayMissedEvents?: boolean; + /** + * The bot's token. + */ + token: string; + /** + * The version of the websocket to connect to. + */ + version?: 1; }; // eslint-disable-next-line @typescript-eslint/consistent-type-definitions export type WebsocketManagerEvents = { - debug(data: any): unknown; - error(reason: string, err: Error | null, data?: any): unknown; - exit(info: string): unknown; - gatewayEvent(event: keyof WSEvent, data: SkeletonWSPayload): unknown; - raw(data: any): unknown; - ready( - user: WSPayload<"_WelcomeMessage">["user"] & { - createdBy: string; - botId: string; - }, - ): unknown; - reconnect(): unknown; - unknown(reason: string, data: any): unknown; + debug(data: unknown): unknown; + error(reason: string, err: Error | null, data?: unknown): unknown; + exit(info: string): unknown; + gatewayEvent(event: keyof WSEvent, data: SkeletonWSPayload): unknown; + raw(data: unknown): unknown; + ready( + user: WSPayload<"_WelcomeMessage">["user"] & { + createdBy: string; + botId: string; + }, + ): unknown; + reconnect(): unknown; + unknown(reason: string, data: unknown): unknown; }; diff --git a/packages/api/package.json b/packages/api/package.json index 175ce587..0241bad1 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -7,15 +7,14 @@ "main": "dist/index.js", "types": "types/index.d.ts", "scripts": { - "lint": "eslint --ignore-path ../../.config/.eslintignore --config ../../.config/.eslintrc.js lib", "build": "tsc && gen-esm-wrapper . ./dist/index.mjs", "build:typecheck": "tsc --noEmit", - "prepublishOnly": "rimraf dist/ && rimraf types/ && pnpm run build", + "prepublishOnly": "rimraf dist/ && rimraf types/ && bun run build", "router:preserve": "ts-node scripts/pre-gen-router.ts", "router:restore": "ts-node scripts/post-gen-router.ts", "generate:ws": "openapi-typescript \"https://www.guilded.gg/api/v1/socket-open-api-schema.json\" --output lib/generated/api-typings/v1/ws.ts", "generate:long:router": "pnpx openapi-typescript-codegen --input \"https://www.guilded.gg/api/v1/open-api-schema.json\" --output lib/generated/router --name GuildedRouter --useOptions --postfixModels Payload --useUnionTypes", - "generate:router": "pnpm router:preserve && pnpm generate:long:router && prettier -w lib/generated/router/**/*.ts && pnpm router:restore" + "generate:router": "bun run router:preserve && bun run generate:long:router && biome check --apply-unsafe lib/generated/router/**/*.ts && pnpm router:restore" }, "devDependencies": { "@types/fs-extra": "^11.0.1", @@ -84,4 +83,4 @@ "url": "https://github.com/zaida04/guilded.js/issues" }, "gitHead": "eee38a19e0bfa812d7136cc78a6bc99e0b402b0c" -} +} \ No newline at end of file diff --git a/packages/api/scripts/post-gen-router.ts b/packages/api/scripts/post-gen-router.ts index 707d8539..33a5b25e 100644 --- a/packages/api/scripts/post-gen-router.ts +++ b/packages/api/scripts/post-gen-router.ts @@ -5,20 +5,22 @@ import { move } from "fs-extra"; const pathsToPreserve = ["lib/generated/router/core/", "lib/generated/router/GuildedRouter.ts"]; const pathsToReplace = { - "lib/generated/router/services/ChatService.ts": ["Record | string;", "string;"], + "lib/generated/router/services/ChatService.ts": ["Record | string;", "string;"], }; const main = async (): Promise => { - for (const path of pathsToPreserve) { - await move(join(__dirname, "..", "preserve", path), join(__dirname, "..", path), { overwrite: true }); - } + for (const path of pathsToPreserve) { + await move(join(__dirname, "..", "preserve", path), join(__dirname, "..", path), { + overwrite: true, + }); + } - for (const path of Object.keys(pathsToReplace)) { - const [old, replace] = pathsToReplace[path as keyof typeof pathsToReplace]; - const concatPath = join(__dirname, "..", path); - const file = await readFile(concatPath, "utf8"); - await writeFile(concatPath, file.replace(old, replace)); - } + for (const path of Object.keys(pathsToReplace)) { + const [old, replace] = pathsToReplace[path as keyof typeof pathsToReplace]; + const concatPath = join(__dirname, "..", path); + const file = await readFile(concatPath, "utf8"); + await writeFile(concatPath, file.replace(old, replace)); + } }; void main(); diff --git a/packages/api/scripts/pre-gen-router.ts b/packages/api/scripts/pre-gen-router.ts index 656101d5..c26e01a1 100644 --- a/packages/api/scripts/pre-gen-router.ts +++ b/packages/api/scripts/pre-gen-router.ts @@ -4,9 +4,11 @@ import { move } from "fs-extra"; export const pathsToPreserve = ["lib/generated/router/core", "lib/generated/router/GuildedRouter.ts"]; const main = async (): Promise => { - for (const path of pathsToPreserve) { - await move(join(__dirname, "..", path), join(__dirname, "..", "preserve", path), { overwrite: true }); - } + for (const path of pathsToPreserve) { + await move(join(__dirname, "..", path), join(__dirname, "..", "preserve", path), { + overwrite: true, + }); + } }; void main(); diff --git a/packages/create-guilded-app/lib/cli.ts b/packages/create-guilded-app/lib/cli.ts index 1e68340b..abdf4c1c 100644 --- a/packages/create-guilded-app/lib/cli.ts +++ b/packages/create-guilded-app/lib/cli.ts @@ -15,13 +15,13 @@ Happy coding! `; void create("create-guilded-app", { - templateRoot, - caveat, - defaultTemplate: "command-handler-starter-js", - promptForAuthor: false, - promptForEmail: false, - promptForTemplate: true, - promptForDescription: false, - promptForLicense: true, - promptForPackageManager: true, + templateRoot, + caveat, + defaultTemplate: "command-handler-starter-js", + promptForAuthor: false, + promptForEmail: false, + promptForTemplate: true, + promptForDescription: false, + promptForLicense: true, + promptForPackageManager: true, }); diff --git a/packages/create-guilded-app/package.json b/packages/create-guilded-app/package.json index d5976f18..05a1c135 100644 --- a/packages/create-guilded-app/package.json +++ b/packages/create-guilded-app/package.json @@ -10,10 +10,9 @@ "create-guilded-app": "./dist/cli.js" }, "scripts": { - "lint": "eslint --ignore-path ../../.config/.eslintignore --config ../../.config/.eslintrc.js lib", "build": "tsc", "build:typecheck": "tsc --noEmit", - "prepublishOnly": "rimraf dist/ && rimraf types/ && pnpm run build" + "prepublishOnly": "rimraf dist/ && rimraf types/ && bun run build" }, "devDependencies": { "@types/node": "18.16.12", @@ -43,4 +42,4 @@ "bugs": { "url": "https://github.com/zaida04/guilded.js/issues" } -} +} \ No newline at end of file diff --git a/packages/create-guilded-app/templates/bot-starter-js/src/index.js b/packages/create-guilded-app/templates/bot-starter-js/src/index.js index 0ac06770..9cd09bd7 100644 --- a/packages/create-guilded-app/templates/bot-starter-js/src/index.js +++ b/packages/create-guilded-app/templates/bot-starter-js/src/index.js @@ -6,36 +6,48 @@ const client = new Client({ token: process.env.TOKEN }); const prefix = process.env.PREFIX; client.on("messageCreated", async (m) => { - if (m.createdByBotId || !m.content.startsWith(prefix)) return; - const [commandName, ...args] = m.content.slice(prefix.length).split(" "); - switch (commandName) { - case "test": { - await m.send("TESTING!"); - break; - } - case "embed": { - await m.send( - new Embed() - .setTitle("This is a test title!") - .setDescription("This is a test description") - .setColor("GREEN") - .setFooter("This is a test footer", "https://google.com/") - .setTimestamp() - .setURL("https://google.com") - .setAuthor("Test author") - .addFields([ - { name: "Test field 1", value: "This is a test field", inline: true }, - { name: "Test field 2", value: "This is a test field", inline: true }, - { name: "Test field 3", value: "This is a test field", inline: false }, - ]), - ); - break; - } - case "echo": { - await m.send(args.join(" ")); - break; - } - } + if (m.createdByBotId || !m.content.startsWith(prefix)) return; + const [commandName, ...args] = m.content.slice(prefix.length).split(" "); + switch (commandName) { + case "test": { + await m.send("TESTING!"); + break; + } + case "embed": { + await m.send( + new Embed() + .setTitle("This is a test title!") + .setDescription("This is a test description") + .setColor("GREEN") + .setFooter("This is a test footer", "https://google.com/") + .setTimestamp() + .setURL("https://google.com") + .setAuthor("Test author") + .addFields([ + { + name: "Test field 1", + value: "This is a test field", + inline: true, + }, + { + name: "Test field 2", + value: "This is a test field", + inline: true, + }, + { + name: "Test field 3", + value: "This is a test field", + inline: false, + }, + ]), + ); + break; + } + case "echo": { + await m.send(args.join(" ")); + break; + } + } }); // client.on("debug", console.log); diff --git a/packages/create-guilded-app/templates/command-handler-starter-js/src/commands/echo.js b/packages/create-guilded-app/templates/command-handler-starter-js/src/commands/echo.js index 68813285..4d1a667e 100644 --- a/packages/create-guilded-app/templates/command-handler-starter-js/src/commands/echo.js +++ b/packages/create-guilded-app/templates/command-handler-starter-js/src/commands/echo.js @@ -1,8 +1,8 @@ module.exports = { - name: "echo", - aliases: ["speak", "talk"], - execute: (msg, args) => { - if (!args.length) return msg.send("You must give me something to echo!"); - msg.send(args.join(" ")); - }, + name: "echo", + aliases: ["speak", "talk"], + execute: (msg, args) => { + if (!args.length) return msg.send("You must give me something to echo!"); + msg.send(args.join(" ")); + }, }; diff --git a/packages/create-guilded-app/templates/command-handler-starter-js/src/commands/ping.js b/packages/create-guilded-app/templates/command-handler-starter-js/src/commands/ping.js index 4f5b200f..18167be3 100644 --- a/packages/create-guilded-app/templates/command-handler-starter-js/src/commands/ping.js +++ b/packages/create-guilded-app/templates/command-handler-starter-js/src/commands/ping.js @@ -1,5 +1,5 @@ module.exports = { - aliases: ["ping"], - execute: (msg) => msg.send("pong!"), - name: "ping", + aliases: ["ping"], + execute: (msg) => msg.send("pong!"), + name: "ping", }; diff --git a/packages/create-guilded-app/templates/command-handler-starter-js/src/index.js b/packages/create-guilded-app/templates/command-handler-starter-js/src/index.js index 08436617..e848e1d6 100644 --- a/packages/create-guilded-app/templates/command-handler-starter-js/src/index.js +++ b/packages/create-guilded-app/templates/command-handler-starter-js/src/index.js @@ -11,19 +11,19 @@ const prefix = process.env.PREFIX; const commands = new Collection(); client.on("messageCreated", async (msg) => { - if (!msg.content.startsWith(prefix)) return; - let [commandName, ...args] = msg.content.slice(prefix.length).trim().split(/ +/); - commandName = commandName.toLowerCase(); - - const command = commands.get(commandName) ?? commands.find((x) => x.aliases?.includes(commandName)); - if (!command) return; - - try { - await command.execute(msg, args); - } catch (e) { - void client.messages.send(msg.channelId, "There was an error executing that command!"); - void console.error(e); - } + if (!msg.content.startsWith(prefix)) return; + let [commandName, ...args] = msg.content.slice(prefix.length).trim().split(/ +/); + commandName = commandName.toLowerCase(); + + const command = commands.get(commandName) ?? commands.find((x) => x.aliases?.includes(commandName)); + if (!command) return; + + try { + await command.execute(msg, args); + } catch (e) { + void client.messages.send(msg.channelId, "There was an error executing that command!"); + void console.error(e); + } }); // client.on("debug", console.log); @@ -32,15 +32,17 @@ client.on("ready", () => console.log("Guilded bot is ready!")); client.on("exit", () => console.log("Disconnected!")); void (async () => { - // read the commands dir and have the file extensions. - const commandDir = await readdir(join(__dirname, "commands"), { withFileTypes: true }); - - // go through all the files/dirs scanned from the readdir, and make sure we only have js files - for (const file of commandDir.filter((x) => x.name.endsWith(".js"))) { - console.log(file.name); - const command = require(join(__dirname, "commands", file.name)); - commands.set(command.name, command); - } - - client.login(); + // read the commands dir and have the file extensions. + const commandDir = await readdir(join(__dirname, "commands"), { + withFileTypes: true, + }); + + // go through all the files/dirs scanned from the readdir, and make sure we only have js files + for (const file of commandDir.filter((x) => x.name.endsWith(".js"))) { + console.log(file.name); + const command = require(join(__dirname, "commands", file.name)); + commands.set(command.name, command); + } + + client.login(); })(); diff --git a/packages/gil/lib/BotClient.ts b/packages/gil/lib/BotClient.ts index a352a927..58770c74 100644 --- a/packages/gil/lib/BotClient.ts +++ b/packages/gil/lib/BotClient.ts @@ -12,423 +12,439 @@ import type Task from "./structures/Task"; import { walk } from "./utils/walk"; export class BotClient extends Client { - /** - * All your bot's monitors will be available here - */ - monitors = new Collection(); - - /** - * All your bot's commands will be available here - */ - commands = new Collection(); - - /** - * All your bot's arguments will be available here - */ - arguments = new Collection(); - - /** - * All your bot's inhibitors will be available here - */ - inhibitors = new Collection(); - - /** - * All your bot's tasks will be available here - */ - tasks = new Collection(); - - /** - * The bot's prefixes per server. - */ - prefixes = new Map(); - - /** - * The message collectors that are pending. - */ - messageCollectors = new Collection(); - - /** - * The path that the end users commands,monitors, inhibitors and others will be located. - */ - sourceFolderPath = this.options.sourceFolderPath ?? path.join(process.cwd(), "src/"); - - constructor(public options: BotClientOptions, autoInit = true) { - super(options); - if (autoInit) void this.init(); - } - - /** - * Get the default client prefix. - */ - get prefix(): string { - return this.options.prefix; - } - - /** - * Get the bot's mention. Guilded api does not provide a way to dynamically detect this so for now its manual. - */ - get botMention(): string | undefined { - return this.options.botMention; - } - - async loadFile(result: any, dir: string, collection: Collection): Promise { - const [filename, file] = result; - const { name } = path.parse(filename); - const piece = file.default ? new file.default(this, name) : new file(this, name); - - let cmd: Command | undefined; - if (dir === "commands" && piece.parentCommand) { - const subcommandNames = piece.parentCommand.split("-"); - for (const subname of subcommandNames) { - // LOOK FOR MAIN COMMAND - if (!cmd) { - const mainCmd = collection.get(subname); - if (mainCmd) { - cmd = mainCmd as Command; - continue; - } else { - throw new Error(`You tried to create a subcommand named ${piece.name}. However, the parent command, ${subname}, was not found.`); - } - } - - const subcmd = cmd?.subcommands?.get(subname) as Command; - if (subcmd) { - cmd = subcmd; - } else { - throw new Error(`You tried to create a subcommand named ${piece.name} inside the main command ${cmd.name}. However, the parent command, ${subname}, was not found.`); - } - } - } - - if (cmd) { - if (!cmd.subcommands) cmd.subcommands = new Collection(); - cmd.subcommands.set(piece.name ?? name, piece); - } else { - collection.set(piece.name ?? name, piece); - } - - if (piece.init) await piece.init(); - } - - /** - * Prepares the bot to run. Ideally used for loading files to the bot. - */ - async init(): Promise { - await Promise.allSettled( - [ - ["monitors", this.monitors] as const, - ["commands", this.commands] as const, - ["arguments", this.arguments] as const, - ["inhibitors", this.inhibitors] as const, - ["tasks", this.tasks] as const, - ].map(async ([dir, collection]) => { - try { - for await (const result of walk(path.join(__dirname, dir))) { - await this.loadFile(result, dir, collection); - } - } catch (error) { - console.log(error); - } - }), - ).catch(() => null); - - // Load all end user files - await Promise.allSettled( - [ - ["monitors", this.monitors] as const, - ["commands", this.commands] as const, - ["arguments", this.arguments] as const, - ["inhibitors", this.inhibitors] as const, - ["tasks", this.tasks] as const, - ].map(async ([dir, collection]) => { - try { - for await (const result of walk(this.options.monitorDirPath ?? path.join(this.sourceFolderPath, dir))) { - await this.loadFile(result, dir, collection); - } - } catch (error) { - console.log(error); - } - }), - ).catch(() => null); - - this.initializeMessageListener(); - this.initializeTasks(); - } - - /** - * Allows users to override and customize the addition of a event listener - */ - initializeMessageListener(): void { - this.on("messageCreated", (message) => this.processMonitors(message)); - } - - /** - * Allows users to override and customize the initialization of scheduled task intervals. - */ - initializeTasks(): void { - this.tasks.forEach(async (task) => { - // TASKS THAT NEED TO RUN IMMEDIATELY ARE EXECUTED FIRST - if (task.runOnStartup) await this.executeTask(task); - - // SET TIMEOUT WILL DETERMINE THE RIGHT TIME TO RUN THE TASK FIRST TIME AFTER STARTUP - setTimeout(async () => { - await this.executeTask(task); - - setInterval(async () => { - await this.executeTask(task); - }, task.millisecondsInterval); - }, Date.now() % task.millisecondsInterval); - }); - } - - /** - * Handler to execute a task when it is time. - */ - async executeTask(task: Task): Promise { - // IF TASK REQUIRES BOT BEING FULLY READY EXIT OUT IF BOT ISN'T READY - if (task.requireReady && !this.readyTimestamp) return; - - console.log(`${bgBlue(`[${this.getTime()}]`)} [TASK: ${bgYellow(black(task.name))}] started.`); - const started = Date.now(); - try { - await task.execute(); - console.log(`${bgBlue(`[${this.getTime()}]`)} [TASK: ${bgGreen(black(task.name))}] executed in ${this.humanizeMilliseconds(Date.now() - started)}.`); - } catch (error) { - console.log(error); - } - } - - /** - * Handler that is run on messages and can - */ - processMonitors(message: Message): void { - for (const [id, monitor] of this.monitors) { - if (monitor.ignoreBots && message.createdByWebhookId) continue; - if (monitor.ignoreOthers && message.authorId !== this.user?.botId) continue; - if (monitor.ignoreEdits && message.updatedAt && message.updatedAt !== message.createdAt) continue; - // TODO: When the api supports using dm channels - // if (monitor.ignoreDM && !message.serverId) return; - void monitor.execute(message); - } - } - - /** - * Converts a number of milliseconds to a easy to read format(1d2h3m). - */ - humanizeMilliseconds(milliseconds: number): string { - // Gets ms into seconds - const time = milliseconds / 1_000; - if (time < 1) return "1s"; - - const days = Math.floor(time / 86_400); - const hours = Math.floor((time % 86_400) / 3_600); - const minutes = Math.floor(((time % 86_400) % 3_600) / 60); - const seconds = Math.floor(((time % 86_400) % 3_600) % 60); - - const dayString = days ? `${days}d ` : ""; - const hourString = hours ? `${hours}h ` : ""; - const minuteString = minutes ? `${minutes}m ` : ""; - const secondString = seconds ? `${seconds}s ` : ""; - - return `${dayString}${hourString}${minuteString}${secondString}`; - } - - /** - * Converts a text form(1d2h3m) of time to a number in milliseconds. - */ - stringToMilliseconds(text: string): number | undefined { - const matches = text.match(/(\d+[dhmsw|])/g); - if (!matches) return; - - let total = 0; - - for (const match of matches) { - // Finds the first of these letters - const validMatch = /([dhmsw])/.exec(match); - // if none of them were found cancel - if (!validMatch) return; - // Get the number which should be before the index of that match - const number = match.slice(0, Math.max(0, validMatch.index)); - // Get the letter that was found - const [letter] = validMatch; - if (!number ?? !letter) return; - - let multiplier = 1_000; - switch (letter.toLowerCase()) { - case `w`: - multiplier = 1_000 * 60 * 60 * 24 * 7; - break; - case `d`: - multiplier = 1_000 * 60 * 60 * 24; - break; - case `h`: - multiplier = 1_000 * 60 * 60; - break; - case `m`: - multiplier = 1_000 * 60; - break; - } - - const amount = number ? Number.parseInt(number, 10) : undefined; - if (!amount && amount !== 0) return; - - total += amount * multiplier; - } - - return total; - } - - /** - * Request some message(s) from a user in a channel. - */ - async needMessage(userId: string, channelId: string, options?: MessageCollectorOptions & { amount?: 1 }): Promise; - async needMessage(userId: string, channelId: string, options: MessageCollectorOptions & { amount?: number }): Promise; - async needMessage(userId: string, channelId: string, options?: MessageCollectorOptions): Promise { - const messages = await this.collectMessages({ - key: userId, - channelId, - createdAt: Date.now(), - filter: options?.filter ?? ((msg): boolean => userId === msg.createdById), - amount: options?.amount ?? 1, - // DEFAULTS TO 5 MINUTES - duration: options?.duration ?? 300_000, - }); - - return (options?.amount ?? 1) > 1 ? messages : messages[0]; - } - - /** - * Handler that will create a collecetor internally. Users should be using needMessage. - */ - async collectMessages(options: CollectMessagesOptions): Promise { - return new Promise((resolve, reject) => { - this.messageCollectors.get(options.key)?.reject("A new collector began before the user responded to the previous one."); - - this.messageCollectors.set(options.key, { - ...options, - messages: [], - resolve, - reject, - }); - }); - } - - /** - * Get a clean string form of the current time. For example: 12:00PM - */ - getTime(): string { - const now = new Date(); - const hours = now.getHours(); - const minute = now.getMinutes(); - - let hour = hours; - let amOrPm = `AM`; - if (hour > 12) { - amOrPm = `PM`; - hour -= 12; - } - - return `${hour >= 10 ? hour : `0${hour}`}:${minute >= 10 ? minute : `0${minute}`} ${amOrPm}`; - } - - /** - * Handler that is executed when a user is using a command too fast and goes into cooldown. Override this to customize the behavior. - */ - async cooldownReached(message: Message, command: Command, options: RespondToCooldownOption): Promise { - return message.reply(`You must wait **${this.humanizeMilliseconds(options.cooldown.timestamp - options.now)}** before using the *${command.fullName}* command again.`); - } + /** + * All your bot's monitors will be available here + */ + monitors = new Collection(); + + /** + * All your bot's commands will be available here + */ + commands = new Collection(); + + /** + * All your bot's arguments will be available here + */ + arguments = new Collection(); + + /** + * All your bot's inhibitors will be available here + */ + inhibitors = new Collection(); + + /** + * All your bot's tasks will be available here + */ + tasks = new Collection(); + + /** + * The bot's prefixes per server. + */ + prefixes = new Map(); + + /** + * The message collectors that are pending. + */ + messageCollectors = new Collection(); + + /** + * The path that the end users commands,monitors, inhibitors and others will be located. + */ + sourceFolderPath = this.options.sourceFolderPath ?? path.join(process.cwd(), "src/"); + + constructor( + public options: BotClientOptions, + autoInit = true, + ) { + super(options); + if (autoInit) void this.init(); + } + + /** + * Get the default client prefix. + */ + get prefix(): string { + return this.options.prefix; + } + + /** + * Get the bot's mention. Guilded api does not provide a way to dynamically detect this so for now its manual. + */ + get botMention(): string | undefined { + return this.options.botMention; + } + + // biome-ignore lint/suspicious/noExplicitAny: + async loadFile(result: any, dir: string, collection: Collection): Promise { + const [filename, file] = result; + const { name } = path.parse(filename); + const piece = file.default ? new file.default(this, name) : new file(this, name); + + let cmd: Command | undefined; + if (dir === "commands" && piece.parentCommand) { + const subcommandNames = piece.parentCommand.split("-"); + for (const subname of subcommandNames) { + // LOOK FOR MAIN COMMAND + if (!cmd) { + const mainCmd = collection.get(subname); + if (mainCmd) { + cmd = mainCmd as Command; + continue; + } + throw new Error(`You tried to create a subcommand named ${piece.name}. However, the parent command, ${subname}, was not found.`); + } + + const subcmd = cmd?.subcommands?.get(subname) as Command; + if (subcmd) { + cmd = subcmd; + } else { + throw new Error(`You tried to create a subcommand named ${piece.name} inside the main command ${cmd.name}. However, the parent command, ${subname}, was not found.`); + } + } + } + + if (cmd) { + if (!cmd.subcommands) cmd.subcommands = new Collection(); + cmd.subcommands.set(piece.name ?? name, piece); + } else { + collection.set(piece.name ?? name, piece); + } + + if (piece.init) await piece.init(); + } + + /** + * Prepares the bot to run. Ideally used for loading files to the bot. + */ + async init(): Promise { + await Promise.allSettled( + [ + ["monitors", this.monitors] as const, + ["commands", this.commands] as const, + ["arguments", this.arguments] as const, + ["inhibitors", this.inhibitors] as const, + ["tasks", this.tasks] as const, + ].map(async ([dir, collection]) => { + try { + for await (const result of walk(path.join(__dirname, dir))) { + await this.loadFile(result, dir, collection); + } + } catch (error) { + console.log(error); + } + }), + ).catch(() => null); + + // Load all end user files + await Promise.allSettled( + [ + ["monitors", this.monitors] as const, + ["commands", this.commands] as const, + ["arguments", this.arguments] as const, + ["inhibitors", this.inhibitors] as const, + ["tasks", this.tasks] as const, + ].map(async ([dir, collection]) => { + try { + for await (const result of walk(this.options.monitorDirPath ?? path.join(this.sourceFolderPath, dir))) { + await this.loadFile(result, dir, collection); + } + } catch (error) { + console.log(error); + } + }), + ).catch(() => null); + + this.initializeMessageListener(); + this.initializeTasks(); + } + + /** + * Allows users to override and customize the addition of a event listener + */ + initializeMessageListener(): void { + this.on("messageCreated", (message) => this.processMonitors(message)); + } + + /** + * Allows users to override and customize the initialization of scheduled task intervals. + */ + initializeTasks(): void { + // biome-ignore lint/complexity/noForEach: Legacy code + this.tasks.forEach(async (task) => { + // TASKS THAT NEED TO RUN IMMEDIATELY ARE EXECUTED FIRST + if (task.runOnStartup) await this.executeTask(task); + + // SET TIMEOUT WILL DETERMINE THE RIGHT TIME TO RUN THE TASK FIRST TIME AFTER STARTUP + setTimeout(async () => { + await this.executeTask(task); + + setInterval(async () => { + await this.executeTask(task); + }, task.millisecondsInterval); + }, Date.now() % task.millisecondsInterval); + }); + } + + /** + * Handler to execute a task when it is time. + */ + async executeTask(task: Task): Promise { + // IF TASK REQUIRES BOT BEING FULLY READY EXIT OUT IF BOT ISN'T READY + if (task.requireReady && !this.readyTimestamp) return; + + console.log(`${bgBlue(`[${this.getTime()}]`)} [TASK: ${bgYellow(black(task.name))}] started.`); + const started = Date.now(); + try { + await task.execute(); + console.log(`${bgBlue(`[${this.getTime()}]`)} [TASK: ${bgGreen(black(task.name))}] executed in ${this.humanizeMilliseconds(Date.now() - started)}.`); + } catch (error) { + console.log(error); + } + } + + /** + * Handler that is run on messages and can + */ + processMonitors(message: Message): void { + for (const [id, monitor] of this.monitors) { + if (monitor.ignoreBots && message.createdByWebhookId) continue; + if (monitor.ignoreOthers && message.authorId !== this.user?.botId) continue; + if (monitor.ignoreEdits && message.updatedAt && message.updatedAt !== message.createdAt) continue; + // TODO: When the api supports using dm channels + // if (monitor.ignoreDM && !message.serverId) return; + void monitor.execute(message); + } + } + + /** + * Converts a number of milliseconds to a easy to read format(1d2h3m). + */ + humanizeMilliseconds(milliseconds: number): string { + // Gets ms into seconds + const time = milliseconds / 1_000; + if (time < 1) return "1s"; + + const days = Math.floor(time / 86_400); + const hours = Math.floor((time % 86_400) / 3_600); + const minutes = Math.floor(((time % 86_400) % 3_600) / 60); + const seconds = Math.floor(((time % 86_400) % 3_600) % 60); + + const dayString = days ? `${days}d ` : ""; + const hourString = hours ? `${hours}h ` : ""; + const minuteString = minutes ? `${minutes}m ` : ""; + const secondString = seconds ? `${seconds}s ` : ""; + + return `${dayString}${hourString}${minuteString}${secondString}`; + } + + /** + * Converts a text form(1d2h3m) of time to a number in milliseconds. + */ + stringToMilliseconds(text: string): number | undefined { + const matches = text.match(/(\d+[dhmsw|])/g); + if (!matches) return; + + let total = 0; + + for (const match of matches) { + // Finds the first of these letters + const validMatch = /([dhmsw])/.exec(match); + // if none of them were found cancel + if (!validMatch) return; + // Get the number which should be before the index of that match + const number = match.slice(0, Math.max(0, validMatch.index)); + // Get the letter that was found + const [letter] = validMatch; + if (!number ?? !letter) return; + + let multiplier = 1_000; + switch (letter.toLowerCase()) { + case "w": + multiplier = 1_000 * 60 * 60 * 24 * 7; + break; + case "d": + multiplier = 1_000 * 60 * 60 * 24; + break; + case "h": + multiplier = 1_000 * 60 * 60; + break; + case "m": + multiplier = 1_000 * 60; + break; + } + + const amount = number ? Number.parseInt(number, 10) : undefined; + if (!amount && amount !== 0) return; + + total += amount * multiplier; + } + + return total; + } + + /** + * Request some message(s) from a user in a channel. + */ + async needMessage( + userId: string, + channelId: string, + options?: MessageCollectorOptions & { + amount?: 1; + }, + ): Promise; + async needMessage( + userId: string, + channelId: string, + options: MessageCollectorOptions & { + amount?: number; + }, + ): Promise; + async needMessage(userId: string, channelId: string, options?: MessageCollectorOptions): Promise { + const messages = await this.collectMessages({ + key: userId, + channelId, + createdAt: Date.now(), + filter: options?.filter ?? ((msg): boolean => userId === msg.createdById), + amount: options?.amount ?? 1, + // DEFAULTS TO 5 MINUTES + duration: options?.duration ?? 300_000, + }); + + return (options?.amount ?? 1) > 1 ? messages : messages[0]; + } + + /** + * Handler that will create a collecetor internally. Users should be using needMessage. + */ + async collectMessages(options: CollectMessagesOptions): Promise { + return new Promise((resolve, reject) => { + this.messageCollectors.get(options.key)?.reject("A new collector began before the user responded to the previous one."); + + this.messageCollectors.set(options.key, { + ...options, + messages: [], + resolve, + reject, + }); + }); + } + + /** + * Get a clean string form of the current time. For example: 12:00PM + */ + getTime(): string { + const now = new Date(); + const hours = now.getHours(); + const minute = now.getMinutes(); + + let hour = hours; + let amOrPm = "AM"; + if (hour > 12) { + amOrPm = "PM"; + hour -= 12; + } + + return `${hour >= 10 ? hour : `0${hour}`}:${minute >= 10 ? minute : `0${minute}`} ${amOrPm}`; + } + + /** + * Handler that is executed when a user is using a command too fast and goes into cooldown. Override this to customize the behavior. + */ + async cooldownReached(message: Message, command: Command, options: RespondToCooldownOption): Promise { + return message.reply(`You must wait **${this.humanizeMilliseconds(options.cooldown.timestamp - options.now)}** before using the *${command.fullName}* command again.`); + } } // export interface BotClientOptions extends ClientOptions { export type BotClientOptions = { - /** - * The bot mention. Most likely @botname This is required as Guilded does not currently give any way to dynamically detect the mention. - */ - botMention?: string; - /** - * The path to a custom dir where commands are located. - */ - commandDirPath?: string; - /** - * The path to a custom dir where the inhibitors are located - */ - inhibitorDirPath?: string; - /** - * The path to a custom dir where the monitors are located - */ - monitorDirPath?: string; - /** - * The prefix that will be used to determine if a message is executing a command. - */ - prefix: string; - /** - * The path that the end users commands, monitors, inhibitors and others will be located. - */ - sourceFolderPath?: string; - // TODO: THESE ARE REMOVED WHEN EXTENDS IS fixed - token: string; + /** + * The bot mention. Most likely @botname This is required as Guilded does not currently give any way to dynamically detect the mention. + */ + botMention?: string; + /** + * The path to a custom dir where commands are located. + */ + commandDirPath?: string; + /** + * The path to a custom dir where the inhibitors are located + */ + inhibitorDirPath?: string; + /** + * The path to a custom dir where the monitors are located + */ + monitorDirPath?: string; + /** + * The prefix that will be used to determine if a message is executing a command. + */ + prefix: string; + /** + * The path that the end users commands, monitors, inhibitors and others will be located. + */ + sourceFolderPath?: string; + // TODO: THESE ARE REMOVED WHEN EXTENDS IS fixed + token: string; }; export type MessageCollectorOptions = { - /** - * The amount of messages to collect before resolving. Defaults to 1 - */ - amount?: number; - /** - * The amount of milliseconds this should collect for before expiring. Defaults to 5 minutes. - */ - duration?: number; - /** - * Function that will filter messages to determine whether to collect this message. Defaults to making sure the message is sent by the same member. - */ - filter?(message: Message): boolean; + /** + * The amount of messages to collect before resolving. Defaults to 1 + */ + amount?: number; + /** + * The amount of milliseconds this should collect for before expiring. Defaults to 5 minutes. + */ + duration?: number; + /** + * Function that will filter messages to determine whether to collect this message. Defaults to making sure the message is sent by the same member. + */ + filter?(message: Message): boolean; }; export type CollectMessagesOptions = { - /** - * The amount of messages to collect before resolving. - */ - amount: number; - /** - * The channel Id where this is listening to - */ - channelId: string; - /** - * The timestamp when this collector was created - */ - createdAt: number; - /** - * The duration in milliseconds how long this collector should last. - */ - duration: number; - /** - * Function that will filter messages to determine whether to collect this message - */ - filter(message: Message): boolean; - /** - * The unique key that will be used to get responses for this. Ideally, meant to be for member id. - */ - key: string; + /** + * The amount of messages to collect before resolving. + */ + amount: number; + /** + * The channel Id where this is listening to + */ + channelId: string; + /** + * The timestamp when this collector was created + */ + createdAt: number; + /** + * The duration in milliseconds how long this collector should last. + */ + duration: number; + /** + * Function that will filter messages to determine whether to collect this message + */ + filter(message: Message): boolean; + /** + * The unique key that will be used to get responses for this. Ideally, meant to be for member id. + */ + key: string; }; export type GilMessageCollector = CollectMessagesOptions & { - /** - * Where the messages are stored if the amount to collect is more than 1. - */ - messages: Message[]; - reject(reason?: any): void; - resolve(value: Message[] | PromiseLike): void; + /** + * Where the messages are stored if the amount to collect is more than 1. + */ + messages: Message[]; + reject(reason?: unknown): void; + resolve(value: Message[] | PromiseLike): void; }; export default BotClient; export type RespondToCooldownOption = { - /** - * The cooldown details - */ - cooldown: Cooldown; - /** - * The timestamp right when the user used the command. - */ - now: number; + /** + * The cooldown details + */ + cooldown: Cooldown; + /** + * The timestamp right when the user used the command. + */ + now: number; }; diff --git a/packages/gil/lib/arguments/...string.ts b/packages/gil/lib/arguments/...string.ts index 4328fe45..dc958c92 100644 --- a/packages/gil/lib/arguments/...string.ts +++ b/packages/gil/lib/arguments/...string.ts @@ -2,17 +2,17 @@ import { Argument } from "../structures/Argument"; import type { CommandArgument } from "../structures/Command"; export class RemainingStringArgument extends Argument { - name = "...string"; + name = "...string"; - execute(argument: CommandArgument, parameters: string[]): string | undefined { - if (!parameters.length) return; + execute(argument: CommandArgument, parameters: string[]): string | undefined { + if (!parameters.length) return; - return argument.lowercase ? parameters.join(" ").toLowerCase() : parameters.join(" "); - } + return argument.lowercase ? parameters.join(" ").toLowerCase() : parameters.join(" "); + } - init(): void { - // shut up eslint - } + init(): void { + // shut up eslint + } } export default RemainingStringArgument; diff --git a/packages/gil/lib/arguments/boolean.ts b/packages/gil/lib/arguments/boolean.ts index 87997f37..7ddf8741 100644 --- a/packages/gil/lib/arguments/boolean.ts +++ b/packages/gil/lib/arguments/boolean.ts @@ -2,19 +2,19 @@ import { Argument } from "../structures/Argument"; import type { CommandArgument } from "../structures/Command"; export class BooleanArgument extends Argument { - name = "boolean"; + name = "boolean"; - execute(argument: CommandArgument, parameters: string[]): boolean | undefined { - const [boolean] = parameters; + execute(argument: CommandArgument, parameters: string[]): boolean | undefined { + const [boolean] = parameters; - if (["true", "false", "on", "off", "enable", "disable"].includes(boolean)) { - return ["true", "on", "enable"].includes(boolean); - } - } + if (["true", "false", "on", "off", "enable", "disable"].includes(boolean)) { + return ["true", "on", "enable"].includes(boolean); + } + } - init(): void { - // shut up eslint - } + init(): void { + // shut up eslint + } } export default BooleanArgument; diff --git a/packages/gil/lib/arguments/command.ts b/packages/gil/lib/arguments/command.ts index 2285ea4a..78812f3f 100644 --- a/packages/gil/lib/arguments/command.ts +++ b/packages/gil/lib/arguments/command.ts @@ -2,23 +2,23 @@ import { Argument } from "../structures/Argument"; import type { Command, CommandArgument } from "../structures/Command"; export class CommandTypeArgument extends Argument { - name = "command"; + name = "command"; - execute(argument: CommandArgument, parameters: string[]): Command | undefined { - const [name] = parameters; - if (!name) return; + execute(argument: CommandArgument, parameters: string[]): Command | undefined { + const [name] = parameters; + if (!name) return; - const commandName = name.toLowerCase(); - const command = this.client.commands.get(commandName); - if (command) return command; + const commandName = name.toLowerCase(); + const command = this.client.commands.get(commandName); + if (command) return command; - // Check if its an alias - return this.client.commands.find((cmd) => Boolean(cmd.aliases?.includes(commandName))); - } + // Check if its an alias + return this.client.commands.find((cmd) => Boolean(cmd.aliases?.includes(commandName))); + } - init(): void { - // shut up eslint - } + init(): void { + // shut up eslint + } } export default CommandTypeArgument; diff --git a/packages/gil/lib/arguments/duration.ts b/packages/gil/lib/arguments/duration.ts index 1d3bf783..cf7498b8 100644 --- a/packages/gil/lib/arguments/duration.ts +++ b/packages/gil/lib/arguments/duration.ts @@ -2,18 +2,18 @@ import { Argument } from "../structures/Argument"; import type { CommandArgument } from "../structures/Command"; export class DurationArgument extends Argument { - name = "duration"; + name = "duration"; - execute(argument: CommandArgument, parameters: string[]): number | undefined { - const [time] = parameters; - if (!time) return; + execute(argument: CommandArgument, parameters: string[]): number | undefined { + const [time] = parameters; + if (!time) return; - return this.client.stringToMilliseconds(time); - } + return this.client.stringToMilliseconds(time); + } - init(): void { - // shut up eslint - } + init(): void { + // shut up eslint + } } export default DurationArgument; diff --git a/packages/gil/lib/arguments/number.ts b/packages/gil/lib/arguments/number.ts index ef23dc14..c2bb831e 100644 --- a/packages/gil/lib/arguments/number.ts +++ b/packages/gil/lib/arguments/number.ts @@ -2,24 +2,24 @@ import { Argument } from "../structures/Argument"; import type { CommandArgument } from "../structures/Command"; export class NumberArgument extends Argument { - name = "number"; + name = "number"; - execute(argument: CommandArgument, parameters: string[]): number | undefined { - const [number] = parameters; + execute(argument: CommandArgument, parameters: string[]): number | undefined { + const [number] = parameters; - const valid = Number(number); - if (!valid) return; + const valid = Number(number); + if (!valid) return; - if (valid < (argument.minimum || 0)) return; - if (argument.maximum && valid > argument.maximum) return; - if (!argument.allowDecimals) return Math.floor(valid); + if (valid < (argument.minimum || 0)) return; + if (argument.maximum && valid > argument.maximum) return; + if (!argument.allowDecimals) return Math.floor(valid); - if (valid) return valid; - } + if (valid) return valid; + } - init(): void { - // shut up eslint - } + init(): void { + // shut up eslint + } } export default NumberArgument; diff --git a/packages/gil/lib/arguments/string.ts b/packages/gil/lib/arguments/string.ts index 49766766..ea70a204 100644 --- a/packages/gil/lib/arguments/string.ts +++ b/packages/gil/lib/arguments/string.ts @@ -2,23 +2,23 @@ import { Argument } from "../structures/Argument"; import type { CommandArgument } from "../structures/Command"; export class StringArgument extends Argument { - name = "string"; + name = "string"; - execute(argument: CommandArgument, parameters: string[]): string | undefined { - const [text] = parameters; + execute(argument: CommandArgument, parameters: string[]): string | undefined { + const [text] = parameters; - const valid = - // If the argument required literals and some string was provided by user - argument.literals?.length && text ? (argument.literals.includes(text.toLowerCase()) ? text : undefined) : text; + const valid = + // If the argument required literals and some string was provided by user + argument.literals?.length && text ? (argument.literals.includes(text.toLowerCase()) ? text : undefined) : text; - if (valid) { - return argument.lowercase ? valid.toLowerCase() : valid; - } - } + if (valid) { + return argument.lowercase ? valid.toLowerCase() : valid; + } + } - init(): void { - // shut up eslint - } + init(): void { + // shut up eslint + } } export default StringArgument; diff --git a/packages/gil/lib/arguments/subcommand.ts b/packages/gil/lib/arguments/subcommand.ts index 3beacbb8..545a8ec7 100644 --- a/packages/gil/lib/arguments/subcommand.ts +++ b/packages/gil/lib/arguments/subcommand.ts @@ -3,21 +3,21 @@ import { Argument } from "../structures/Argument"; import type { Command, CommandArgument } from "../structures/Command"; export class SubcommandArgument extends Argument { - name = "subcommand"; + name = "subcommand"; - execute(argument: CommandArgument, parameters: string[], message: Message, command: Command): Command | undefined { - const subcommandName = parameters[0]?.toLowerCase(); - if (!subcommandName) return; + execute(argument: CommandArgument, parameters: string[], message: Message, command: Command): Command | undefined { + const subcommandName = parameters[0]?.toLowerCase(); + if (!subcommandName) return; - const sub = command.subcommands?.find((sub) => sub.name === subcommandName || Boolean(sub.aliases?.includes(subcommandName))); - if (sub) return sub; + const sub = command.subcommands?.find((sub) => sub.name === subcommandName || Boolean(sub.aliases?.includes(subcommandName))); + if (sub) return sub; - return typeof argument.defaultValue === "string" ? command.subcommands?.get(argument.defaultValue) : undefined; - } + return typeof argument.defaultValue === "string" ? command.subcommands?.get(argument.defaultValue) : undefined; + } - init(): void { - // shut up eslint - } + init(): void { + // shut up eslint + } } export default SubcommandArgument; diff --git a/packages/gil/lib/commands/ping.ts b/packages/gil/lib/commands/ping.ts index f2b5f308..f8d6bc43 100644 --- a/packages/gil/lib/commands/ping.ts +++ b/packages/gil/lib/commands/ping.ts @@ -2,15 +2,15 @@ import type { Message } from "guilded.js"; import { Command } from "../structures/Command"; export class PingCommand extends Command { - name = "ping"; + name = "ping"; - execute(message: Message): any { - return this.client.messages.send(message.channelId, "Pong"); - } + execute(message: Message) { + return this.client.messages.send(message.channelId, "Pong"); + } - init(): void { - // comment to shut up eslint error - } + init(): void { + // comment to shut up eslint error + } } export default PingCommand; diff --git a/packages/gil/lib/inhibitors/allowedIn.ts b/packages/gil/lib/inhibitors/allowedIn.ts index 15aaf9c1..b7fb79d6 100644 --- a/packages/gil/lib/inhibitors/allowedIn.ts +++ b/packages/gil/lib/inhibitors/allowedIn.ts @@ -3,24 +3,24 @@ import type { Command } from "../structures/Command"; import { Inhibitor } from "../structures/Inhibitor"; export class AllowedInInhibitor extends Inhibitor { - name = "allowedIn"; + name = "allowedIn"; - execute(message: Message, command: Command): boolean { - // The command should be allowed to run because it meets the requirements - // allowedIn defaults to ["server"] - if ((!command.allowedIn || command.allowedIn.includes("server")) && message.serverId) return false; + execute(message: Message, command: Command): boolean { + // The command should be allowed to run because it meets the requirements + // allowedIn defaults to ["server"] + if ((!command.allowedIn || command.allowedIn.includes("server")) && message.serverId) return false; - // If the command is allowed in dms - if (command.allowedIn?.includes("dm") && !message.serverId) return false; + // If the command is allowed in dms + if (command.allowedIn?.includes("dm") && !message.serverId) return false; - // THE COMMANDS NEEDS TO BE INHIBITED. - console.log(`${command.name} Inhibited: ALLOWED IN`); - return true; - } + // THE COMMANDS NEEDS TO BE INHIBITED. + console.log(`${command.name} Inhibited: ALLOWED IN`); + return true; + } - init(): void { - // shut up eslint - } + init(): void { + // shut up eslint + } } export default AllowedInInhibitor; diff --git a/packages/gil/lib/inhibitors/cooldown.ts b/packages/gil/lib/inhibitors/cooldown.ts index 0344b8f5..480e53b7 100644 --- a/packages/gil/lib/inhibitors/cooldown.ts +++ b/packages/gil/lib/inhibitors/cooldown.ts @@ -4,60 +4,60 @@ import type { Command } from "../structures/Command"; import { Inhibitor } from "../structures/Inhibitor"; export class CooldownInhibitor extends Inhibitor { - name = "cooldown"; - - /** - * The collection of users that are in cooldown - */ - membersInCooldown = new Collection(); - - async execute(message: Message, command: Command): Promise { - if (!command.cooldown) return false; - - const key = `${message.createdById}-${command.name}`; - const cooldown = this.membersInCooldown.get(key); - if (cooldown) { - if (cooldown.used >= (command.cooldown.allowedUses || 1)) { - const now = Date.now(); - if (cooldown.timestamp > now) { - await this.client.cooldownReached(message, command, { - now, - cooldown, - }); - return true; - } - - cooldown.used = 0; - } - - this.membersInCooldown.set(key, { - used: cooldown.used + 1, - timestamp: Date.now() + command.cooldown.seconds * 1_000, - }); - return false; - } - - this.membersInCooldown.set(key, { - used: 1, - timestamp: Date.now() + command.cooldown.seconds * 1_000, - }); - return false; - } - - init(): void { - // shut up eslint - } + name = "cooldown"; + + /** + * The collection of users that are in cooldown + */ + membersInCooldown = new Collection(); + + async execute(message: Message, command: Command): Promise { + if (!command.cooldown) return false; + + const key = `${message.createdById}-${command.name}`; + const cooldown = this.membersInCooldown.get(key); + if (cooldown) { + if (cooldown.used >= (command.cooldown.allowedUses || 1)) { + const now = Date.now(); + if (cooldown.timestamp > now) { + await this.client.cooldownReached(message, command, { + now, + cooldown, + }); + return true; + } + + cooldown.used = 0; + } + + this.membersInCooldown.set(key, { + used: cooldown.used + 1, + timestamp: Date.now() + command.cooldown.seconds * 1_000, + }); + return false; + } + + this.membersInCooldown.set(key, { + used: 1, + timestamp: Date.now() + command.cooldown.seconds * 1_000, + }); + return false; + } + + init(): void { + // shut up eslint + } } export type Cooldown = { - /** - * The timestamp when this command should be available to use again. - */ - timestamp: number; - /** - * The amount of times a command was used. - */ - used: number; + /** + * The timestamp when this command should be available to use again. + */ + timestamp: number; + /** + * The amount of times a command was used. + */ + used: number; }; export default CooldownInhibitor; diff --git a/packages/gil/lib/monitors/commands.ts b/packages/gil/lib/monitors/commands.ts index db094524..9a85aae4 100644 --- a/packages/gil/lib/monitors/commands.ts +++ b/packages/gil/lib/monitors/commands.ts @@ -4,189 +4,195 @@ import type { Command } from "../structures/Command"; import { Monitor } from "../structures/Monitor"; export class CommandsMonitor extends Monitor { - // Commands should not ignore dms. - ignoreDM = false; - - execute(message: Message): unknown { - let prefix = this.parsePrefix(message.serverId); - - // If the message is not using the valid prefix or bot mention cancel the command - // IF THE MESSAGE IS ONLY BOT MENTION, SEND THE PREFIX - if (this.client.botMention) { - if (this.client.botMention === message.content) return this.client.messages.send(message.channelId, { content: this.parsePrefix(message.serverId), replyMessageIds: [message.id] }); - // IF THE MESSAGE STARTS WITH BOT MENTION, USE MENTION AS PREFIX - else if (message.content.startsWith(this.client.botMention)) prefix = this.client.botMention; - } - - // IF NO PREFIX IS USED, CANCEL - if (!message.content.startsWith(prefix)) return; - - // `!ping testing` becomes `ping` - const [commandName, ...parameters] = message.content.slice(prefix.length).split(" "); - - // Check if this is a valid command - const command = this.parseCommand(commandName); - if (!command) return; - - this.logCommand(message, "Trigger", commandName); - - // TODO: implement a global user cooldown system - - void this.executeCommand(message, command, parameters); - } - - parsePrefix(serverId?: string | null): string { - const prefix = serverId ? this.client.prefixes.get(serverId) : this.client.prefix; - return prefix ?? this.client.prefix; - } - - parseCommand(commandName: string): Command | undefined { - commandName = commandName.toLowerCase(); - const command = this.client.commands.get(commandName); - if (command) return command; - - // Check aliases if the command wasn't found - return this.client.commands.find((cmd) => Boolean(cmd.aliases?.includes(commandName))); - } - - logCommand(message: Message, type: "Failure" | "Inhibit" | "Missing" | "Slowmode" | "Success" | "Trigger", commandName: string): void { - // TODO: use server name when available in api - const serverName = message.serverId ?? "DM"; - - const command = `[COMMAND: ${bgYellow(black(commandName ?? "Unknown"))} - ${bgBlack( - ["Failure", "Slowmode", "Missing"].includes(type) ? red(type) : type === "Success" ? green(type) : white(type), - )}]`; - - // TODO: use message author tag or name here - const user = bgGreen(black(`${""}(${message.createdById})`)); - const guild = bgMagenta(black(`${serverName}${message.serverId ? `(${message.serverId})` : ""}`)); - - console.log(`${bgBlue(`[${this.client.getTime()}]`)} ${command} by ${user} in ${guild} with Message ID: ${message.id}`); - } - - async executeCommand(message: Message, command: Command, parameters: string[]): Promise { - try { - // bot.slowmode.set(message.author.id, message.timestamp); - - // Parsed args and validated - const args = await this.parseArguments(message, command, parameters); - // Some arg that was required was missing and handled already - if (!args) { - this.logCommand(message, "Missing", command.name); - return; - } - - // If no subcommand execute the command - const [argument] = command.arguments ?? []; - const subcommand = argument ? (args[argument.name] as Command) : undefined; - - if (!argument || argument.type !== "subcommand" || !subcommand) { - // Check subcommand permissions and options - if (!(await this.commandAllowed(message, command))) return; - - await command.execute?.(message, args); - this.logCommand(message, "Success", command.parentCommand ? `${command.parentCommand}-${command.name}` : command.name); - return; - } - - // A subcommand was asked for in this command - if ([subcommand.name, ...(subcommand.aliases ?? [])].includes(parameters[0])) { - const subParameters = parameters.slice(1); - void this.executeCommand(message, subcommand, subParameters); - } else { - void this.executeCommand(message, subcommand, parameters); - } - } catch (error) { - console.error(error); - this.logCommand(message, "Failure", command.name); - } - } - - async parseArguments(message: Message, command: Command, parameters: string[]): Promise | false> { - const args: { [key: string]: unknown } = {}; - if (!command.arguments) return args; - - let missingRequiredArg = false; - - // Clone the parameters so we can modify it without editing original array - const params = [...parameters]; - - // Loop over each argument and validate - for (const argument of command.arguments) { - const resolver = this.client.arguments.get(argument.type ?? "string"); - if (!resolver) continue; - - const result = await resolver.execute(argument, params, message, command); - if (result !== undefined) { - // Assign the valid argument - args[argument.name] = result; - // This will use up all args so immediately exist the loop. - if (argument.type && ["subcommands", "...strings", "...roles", "...emojis", "...snowflakes"].includes(argument.type)) { - break; - } - - // Remove a param for the next argument - params.shift(); - continue; - } - - // Invalid arg provided. - if (Object.hasOwn(argument, "defaultValue")) { - args[argument.name] = argument.defaultValue; - } else if (argument.required !== false) { - if (argument.missing) { - missingRequiredArg = true; - argument.missing?.(message); - break; - } - - // A REQUIRED ARG WAS MISSING TRY TO COLLECT IT - // TODO: perm check before sending - const question = await this.client.messages.send(message.channelId, { - content: `You were missing the **${argument.name}** argument which is required in that command. Please provide the **${ - argument.type === "subcommand" ? command.subcommands?.map((sub) => sub.name).join(", ") ?? "subcommand" : argument.type - }** now.`, - replyMessageIds: [message.id], - }); - if (question) { - const response = await this.client.needMessage(message.createdById, message.channelId); - if (response) { - const responseArg = await resolver.execute(argument, [response.content], message, command); - if (responseArg) { - args[argument.name] = responseArg; - params.shift(); - // TODO: perm checks to delete message - await Promise.all([this.client.messages.delete(message.channelId, message.id), this.client.messages.delete(message.channelId, response.id)]); - continue; - } - } - } - - missingRequiredArg = true; - // @ts-expect-error fix this dumb error. TODO: idk why this is erroring - argument.missing?.(message); - break; - } - } - - // If an arg was missing then return false so we can error out as an object {} will always be truthy - return missingRequiredArg ? false : args; - } - - async commandAllowed(message: Message, command: Command): Promise { - const inhibitorResults = await Promise.all([...this.client.inhibitors.values()].map((inhibitor) => inhibitor.execute(message, command))); - - if (inhibitorResults.includes(true)) { - this.logCommand(message, "Inhibit", command.name); - return false; - } - - return true; - } - - init(): unknown { - return void 0; - } + // Commands should not ignore dms. + ignoreDM = false; + + execute(message: Message): unknown { + let prefix = this.parsePrefix(message.serverId); + + // If the message is not using the valid prefix or bot mention cancel the command + // IF THE MESSAGE IS ONLY BOT MENTION, SEND THE PREFIX + if (this.client.botMention) { + if (this.client.botMention === message.content) + return this.client.messages.send(message.channelId, { + content: this.parsePrefix(message.serverId), + replyMessageIds: [message.id], + }); + // IF THE MESSAGE STARTS WITH BOT MENTION, USE MENTION AS PREFIX + if (message.content.startsWith(this.client.botMention)) prefix = this.client.botMention; + } + + // IF NO PREFIX IS USED, CANCEL + if (!message.content.startsWith(prefix)) return; + + // `!ping testing` becomes `ping` + const [commandName, ...parameters] = message.content.slice(prefix.length).split(" "); + + // Check if this is a valid command + const command = this.parseCommand(commandName); + if (!command) return; + + this.logCommand(message, "Trigger", commandName); + + // TODO: implement a global user cooldown system + + void this.executeCommand(message, command, parameters); + } + + parsePrefix(serverId?: string | null): string { + const prefix = serverId ? this.client.prefixes.get(serverId) : this.client.prefix; + return prefix ?? this.client.prefix; + } + + parseCommand(commandName: string): Command | undefined { + commandName = commandName.toLowerCase(); + const command = this.client.commands.get(commandName); + if (command) return command; + + // Check aliases if the command wasn't found + return this.client.commands.find((cmd) => Boolean(cmd.aliases?.includes(commandName))); + } + + logCommand(message: Message, type: "Failure" | "Inhibit" | "Missing" | "Slowmode" | "Success" | "Trigger", commandName: string): void { + // TODO: use server name when available in api + const serverName = message.serverId ?? "DM"; + + const command = `[COMMAND: ${bgYellow(black(commandName ?? "Unknown"))} - ${bgBlack( + ["Failure", "Slowmode", "Missing"].includes(type) ? red(type) : type === "Success" ? green(type) : white(type), + )}]`; + + // TODO: use message author tag or name here + const user = bgGreen(black(`${""}(${message.createdById})`)); + const guild = bgMagenta(black(`${serverName}${message.serverId ? `(${message.serverId})` : ""}`)); + + console.log(`${bgBlue(`[${this.client.getTime()}]`)} ${command} by ${user} in ${guild} with Message ID: ${message.id}`); + } + + async executeCommand(message: Message, command: Command, parameters: string[]): Promise { + try { + // bot.slowmode.set(message.author.id, message.timestamp); + + // Parsed args and validated + const args = await this.parseArguments(message, command, parameters); + // Some arg that was required was missing and handled already + if (!args) { + this.logCommand(message, "Missing", command.name); + return; + } + + // If no subcommand execute the command + const [argument] = command.arguments ?? []; + const subcommand = argument ? (args[argument.name] as Command) : undefined; + + if (!argument || argument.type !== "subcommand" || !subcommand) { + // Check subcommand permissions and options + if (!(await this.commandAllowed(message, command))) return; + + await command.execute?.(message, args); + this.logCommand(message, "Success", command.parentCommand ? `${command.parentCommand}-${command.name}` : command.name); + return; + } + + // A subcommand was asked for in this command + if ([subcommand.name, ...(subcommand.aliases ?? [])].includes(parameters[0])) { + const subParameters = parameters.slice(1); + void this.executeCommand(message, subcommand, subParameters); + } else { + void this.executeCommand(message, subcommand, parameters); + } + } catch (error) { + console.error(error); + this.logCommand(message, "Failure", command.name); + } + } + + async parseArguments(message: Message, command: Command, parameters: string[]): Promise | false> { + const args: { + [key: string]: unknown; + } = {}; + if (!command.arguments) return args; + + let missingRequiredArg = false; + + // Clone the parameters so we can modify it without editing original array + const params = [...parameters]; + + // Loop over each argument and validate + for (const argument of command.arguments) { + const resolver = this.client.arguments.get(argument.type ?? "string"); + if (!resolver) continue; + + const result = await resolver.execute(argument, params, message, command); + if (result !== undefined) { + // Assign the valid argument + args[argument.name] = result; + // This will use up all args so immediately exist the loop. + if (argument.type && ["subcommands", "...strings", "...roles", "...emojis", "...snowflakes"].includes(argument.type)) { + break; + } + + // Remove a param for the next argument + params.shift(); + continue; + } + + // Invalid arg provided. + if (Object.hasOwn(argument, "defaultValue")) { + args[argument.name] = argument.defaultValue; + } else if (argument.required !== false) { + if (argument.missing) { + missingRequiredArg = true; + argument.missing?.(message); + break; + } + + // A REQUIRED ARG WAS MISSING TRY TO COLLECT IT + // TODO: perm check before sending + const question = await this.client.messages.send(message.channelId, { + content: `You were missing the **${argument.name}** argument which is required in that command. Please provide the **${ + argument.type === "subcommand" ? command.subcommands?.map((sub) => sub.name).join(", ") ?? "subcommand" : argument.type + }** now.`, + replyMessageIds: [message.id], + }); + if (question) { + const response = await this.client.needMessage(message.createdById, message.channelId); + if (response) { + const responseArg = await resolver.execute(argument, [response.content], message, command); + if (responseArg) { + args[argument.name] = responseArg; + params.shift(); + // TODO: perm checks to delete message + await Promise.all([this.client.messages.delete(message.channelId, message.id), this.client.messages.delete(message.channelId, response.id)]); + continue; + } + } + } + + missingRequiredArg = true; + // @ts-expect-error fix this dumb error. TODO: idk why this is erroring + argument.missing?.(message); + break; + } + } + + // If an arg was missing then return false so we can error out as an object {} will always be truthy + return missingRequiredArg ? false : args; + } + + async commandAllowed(message: Message, command: Command): Promise { + const inhibitorResults = await Promise.all([...this.client.inhibitors.values()].map((inhibitor) => inhibitor.execute(message, command))); + + if (inhibitorResults.includes(true)) { + this.logCommand(message, "Inhibit", command.name); + return false; + } + + return true; + } + + init(): unknown { + return; + } } export default CommandsMonitor; diff --git a/packages/gil/lib/monitors/messageCollector.ts b/packages/gil/lib/monitors/messageCollector.ts index 354ced46..98df6a56 100644 --- a/packages/gil/lib/monitors/messageCollector.ts +++ b/packages/gil/lib/monitors/messageCollector.ts @@ -2,29 +2,29 @@ import type { Message } from "guilded.js"; import { Monitor } from "../structures/Monitor"; export class MessageCollectorMonitor extends Monitor { - execute(message: Message): void { - const collector = this.client.messageCollectors.get(message.createdById); - // This user has no collectors pending or the message is in a different channel - if (!collector || message.channelId !== collector.channelId) return; - // This message is a response to a collector. Now running the filter function. - if (!collector.filter(message)) return; + execute(message: Message): void { + const collector = this.client.messageCollectors.get(message.createdById); + // This user has no collectors pending or the message is in a different channel + if (!collector || message.channelId !== collector.channelId) return; + // This message is a response to a collector. Now running the filter function. + if (!collector.filter(message)) return; - // If the necessary amount has been collected - if (collector.amount === 1 || collector.amount === collector.messages.length + 1) { - // Remove the collector - this.client.messageCollectors.delete(message.createdById); - // Resolve the collector - collector.resolve([...collector.messages, message]); - return; - } + // If the necessary amount has been collected + if (collector.amount === 1 || collector.amount === collector.messages.length + 1) { + // Remove the collector + this.client.messageCollectors.delete(message.createdById); + // Resolve the collector + collector.resolve([...collector.messages, message]); + return; + } - // More messages still need to be collected - collector.messages.push(message); - } + // More messages still need to be collected + collector.messages.push(message); + } - init(): void { - // shut up eslint - } + init(): void { + // shut up eslint + } } export default MessageCollectorMonitor; diff --git a/packages/gil/lib/structures/Argument.ts b/packages/gil/lib/structures/Argument.ts index 738a1160..5322eaaf 100644 --- a/packages/gil/lib/structures/Argument.ts +++ b/packages/gil/lib/structures/Argument.ts @@ -3,11 +3,14 @@ import type { BotClient } from "../BotClient"; import type { Command, CommandArgument } from "./Command"; export abstract class Argument { - constructor(public readonly client: BotClient, public name: string) {} + constructor( + public readonly client: BotClient, + public name: string, + ) {} - abstract execute(argument: CommandArgument, parameters: string[], message: Message, command: Command): Promise | unknown; + abstract execute(argument: CommandArgument, parameters: string[], message: Message, command: Command): Promise | unknown; - abstract init(): Promise | unknown; + abstract init(): Promise | unknown; } export default Argument; diff --git a/packages/gil/lib/structures/Command.ts b/packages/gil/lib/structures/Command.ts index 118f607a..8659b16e 100644 --- a/packages/gil/lib/structures/Command.ts +++ b/packages/gil/lib/structures/Command.ts @@ -3,96 +3,99 @@ import type { Message } from "guilded.js"; import type { BotClient } from "../BotClient"; export abstract class Command { - /** - * The command aliases are stored here. - */ - aliases?: string[]; + /** + * The command aliases are stored here. + */ + aliases?: string[]; - /** - * The arguments you wish to request from the user. - */ - arguments?: readonly CommandArgument[]; + /** + * The arguments you wish to request from the user. + */ + arguments?: readonly CommandArgument[]; - /** - * Where is this command allowed to run in? By default, it is allowed to run in a server only! - */ - allowedIn?: ("dm" | "server")[] = ["server"]; + /** + * Where is this command allowed to run in? By default, it is allowed to run in a server only! + */ + allowedIn?: ("dm" | "server")[] = ["server"]; - /** - * The description of the command - */ - description?: string; + /** + * The description of the command + */ + description?: string; - /** - * The cooldown settings for this command. - */ - cooldown?: { - allowedUses?: number; - seconds: number; - }; + /** + * The cooldown settings for this command. + */ + cooldown?: { + allowedUses?: number; + seconds: number; + }; - /** - * The subcommands for this command. - */ - subcommands?: Collection; + /** + * The subcommands for this command. + */ + subcommands?: Collection; - /** - * The name of the parent command. If nested subcommands, use `-` to separate the names. For example: `.settings staff modrole` would be parentCommand: "settings-staff" - */ - parentCommand?: string; + /** + * The name of the parent command. If nested subcommands, use `-` to separate the names. For example: `.settings staff modrole` would be parentCommand: "settings-staff" + */ + parentCommand?: string; - constructor(public readonly client: BotClient, public name: string) {} + constructor( + public readonly client: BotClient, + public name: string, + ) {} - abstract execute(message: Message, args: Record): Promise | unknown; + abstract execute(message: Message, args: Record): Promise | unknown; - abstract init(): Promise | unknown; + abstract init(): Promise | unknown; - get fullName(): string { - return `${this.parentCommand ? `${this.parentCommand.split("-").join(" ")} ` : ""}${this.name}`; - } + get fullName(): string { + return `${this.parentCommand ? `${this.parentCommand.split("-").join(" ")} ` : ""}${this.name}`; + } } export type CommandArgument = { - /** - * If the type is a number, you can use this to allow/disable non-integers. By default this is false. - */ - allowDecimals?: boolean; - /** - * The default value for this argument/subcommand. - */ - defaultValue?: boolean | number | string; - /** - * If the type is string or subcommand you can provide literals. The argument MUST be exactly the same as the literals to be accepted. For example, you can list the subcommands here to make sure it matches. - */ - literals?: string[]; - /** - * If the type is string, this will force this argument to be lowercase. - */ - lowercase?: boolean; - /** - * If the type is a number set the maximum amount. By default this is disabled. - */ - maximum?: number; - /** - * If the type is number set the minimum amount. By default the minimum is 0 - */ - minimum?: number; - /** - * The function that runs if this argument is required and is missing. - */ - missing?(message: Message): unknown; - /** - * The name of the argument. Useful for when you need to alert the user X arg is missing. - */ - name: string; - /** - * Whether or not this argument is required. Defaults to true. - */ - required?: boolean; - /** - * The type of the argument you would like. Defaults to string. - */ - type?: "...string" | "boolean" | "duration" | "number" | "string" | "subcommand"; + /** + * If the type is a number, you can use this to allow/disable non-integers. By default this is false. + */ + allowDecimals?: boolean; + /** + * The default value for this argument/subcommand. + */ + defaultValue?: boolean | number | string; + /** + * If the type is string or subcommand you can provide literals. The argument MUST be exactly the same as the literals to be accepted. For example, you can list the subcommands here to make sure it matches. + */ + literals?: string[]; + /** + * If the type is string, this will force this argument to be lowercase. + */ + lowercase?: boolean; + /** + * If the type is a number set the maximum amount. By default this is disabled. + */ + maximum?: number; + /** + * If the type is number set the minimum amount. By default the minimum is 0 + */ + minimum?: number; + /** + * The function that runs if this argument is required and is missing. + */ + missing?(message: Message): unknown; + /** + * The name of the argument. Useful for when you need to alert the user X arg is missing. + */ + name: string; + /** + * Whether or not this argument is required. Defaults to true. + */ + required?: boolean; + /** + * The type of the argument you would like. Defaults to string. + */ + type?: "...string" | "boolean" | "duration" | "number" | "string" | "subcommand"; }; export default Command; diff --git a/packages/gil/lib/structures/Inhibitor.ts b/packages/gil/lib/structures/Inhibitor.ts index 71334dd9..bceb124f 100644 --- a/packages/gil/lib/structures/Inhibitor.ts +++ b/packages/gil/lib/structures/Inhibitor.ts @@ -3,11 +3,14 @@ import type { BotClient } from "../BotClient"; import type { Command } from "./Command"; export abstract class Inhibitor { - constructor(public readonly client: BotClient, public name: string) {} + constructor( + public readonly client: BotClient, + public name: string, + ) {} - abstract execute(message: Message, command: Command): Promise | boolean; + abstract execute(message: Message, command: Command): Promise | boolean; - abstract init(): Promise | unknown; + abstract init(): Promise | unknown; } export default Inhibitor; diff --git a/packages/gil/lib/structures/Monitor.ts b/packages/gil/lib/structures/Monitor.ts index f693fbd7..e5bb56a2 100644 --- a/packages/gil/lib/structures/Monitor.ts +++ b/packages/gil/lib/structures/Monitor.ts @@ -2,31 +2,34 @@ import type { Message } from "guilded.js"; import type { BotClient } from "../BotClient"; export abstract class Monitor { - /** - * Whether this monitor should ignore messages that are sent by bots. By default this is true. - */ - ignoreBots = true; - - /** - * Whether this monitor should ignore messages that are sent by others. By default this is false. - */ - ignoreOthers = false; - - /** - * Whether this monitor should ignore messages that are edited. By default this is false. - */ - ignoreEdits = false; - - /** - * Whether this monitor should ignore messages that are sent in DM. By default this is true. - */ - ignoreDM = true; - - constructor(public readonly client: BotClient, public name: string) {} - - abstract execute(message: Message): Promise | unknown; - - abstract init(): Promise | unknown; + /** + * Whether this monitor should ignore messages that are sent by bots. By default this is true. + */ + ignoreBots = true; + + /** + * Whether this monitor should ignore messages that are sent by others. By default this is false. + */ + ignoreOthers = false; + + /** + * Whether this monitor should ignore messages that are edited. By default this is false. + */ + ignoreEdits = false; + + /** + * Whether this monitor should ignore messages that are sent in DM. By default this is true. + */ + ignoreDM = true; + + constructor( + public readonly client: BotClient, + public name: string, + ) {} + + abstract execute(message: Message): Promise | unknown; + + abstract init(): Promise | unknown; } export default Monitor; diff --git a/packages/gil/lib/structures/Task.ts b/packages/gil/lib/structures/Task.ts index ee629a5c..f0a94d7a 100644 --- a/packages/gil/lib/structures/Task.ts +++ b/packages/gil/lib/structures/Task.ts @@ -1,26 +1,29 @@ import type { BotClient } from "../BotClient"; export abstract class Task { - /** - * The amount of time this task should take to run. Defaults to 1 hour(3,600,000 ms) - */ - millisecondsInterval = 60 * 60 * 1_000; + /** + * The amount of time this task should take to run. Defaults to 1 hour(3,600,000 ms) + */ + millisecondsInterval = 60 * 60 * 1_000; - /** - * Whether or not this task should run immediately on startup. Default to false. - */ - runOnStartup = false; + /** + * Whether or not this task should run immediately on startup. Default to false. + */ + runOnStartup = false; - /** - * Whether this task requires the bot to be fully ready before running. Default to false. - */ - requireReady = false; + /** + * Whether this task requires the bot to be fully ready before running. Default to false. + */ + requireReady = false; - constructor(public readonly client: BotClient, public name: string) {} + constructor( + public readonly client: BotClient, + public name: string, + ) {} - abstract execute(): Promise | unknown; + abstract execute(): Promise | unknown; - abstract init(): Promise | unknown; + abstract init(): Promise | unknown; } export default Task; diff --git a/packages/gil/lib/utils/walk.ts b/packages/gil/lib/utils/walk.ts index 3de33470..817bd1b5 100644 --- a/packages/gil/lib/utils/walk.ts +++ b/packages/gil/lib/utils/walk.ts @@ -5,31 +5,31 @@ import { yellowBright } from "colorette"; /** * Walks through a directory allowing you to process it with a for await loop */ -export async function* walk(dir: string): AsyncGenerator { - const folder = await opendir(dir).catch((error) => { - if (error.message.startsWith("ENOENT: no such file or directory")) { - console.log(yellowBright(`[WARN] Missing folder: ${dir.slice(Math.max(0, dir.lastIndexOf("/")))}. To make this warning go away, simply create the folder in your src folder.`)); - } else console.log(error); - }); - if (!folder) return; +export async function* walk(dir: string): AsyncGenerator { + const folder = await opendir(dir).catch((error) => { + if (error.message.startsWith("ENOENT: no such file or directory")) { + console.log(yellowBright(`[WARN] Missing folder: ${dir.slice(Math.max(0, dir.lastIndexOf("/")))}. To make this warning go away, simply create the folder in your src folder.`)); + } else console.log(error); + }); + if (!folder) return; - const directories: string[] = []; + const directories: string[] = []; - for await (const d of folder) { - const entry = path.join(dir, d.name); - // if (d.isDirectory()) yield* walk(entry); - if (d.isDirectory()) directories.push(entry); + for await (const d of folder) { + const entry = path.join(dir, d.name); + // if (d.isDirectory()) yield* walk(entry); + if (d.isDirectory()) directories.push(entry); - // Skip any non-js/ts file - if (![".js", ".ts"].some((suffix) => entry.endsWith(suffix))) continue; - // since declaration files end with ts they need to be ignored as well - else if (entry.endsWith(".d.ts")) continue; - // eslint-disable-next-line @typescript-eslint/no-require-imports - else if (d.isFile()) yield [d.name, require(entry)]; - } + // Skip any non-js/ts file + if (![".js", ".ts"].some((suffix) => entry.endsWith(suffix))) continue; + // since declaration files end with ts they need to be ignored as well + if (entry.endsWith(".d.ts")) continue; + // eslint-disable-next-line @typescript-eslint/no-require-imports + if (d.isFile()) yield [d.name, require(entry)]; + } - // LOAD DIRECTORIES AFTER FILES TO ALLOW SUBCOMMANDS TO HAVE COMMAND FILES MADE FIRST! - for (const directory of directories) yield* walk(directory); + // LOAD DIRECTORIES AFTER FILES TO ALLOW SUBCOMMANDS TO HAVE COMMAND FILES MADE FIRST! + for (const directory of directories) yield* walk(directory); } export default walk; diff --git a/packages/gil/package.json b/packages/gil/package.json index 1eac1773..55fee699 100644 --- a/packages/gil/package.json +++ b/packages/gil/package.json @@ -7,11 +7,10 @@ "main": "dist/index.js", "types": "types/index.d.ts", "scripts": { - "lint": "eslint --ignore-path ../../.config/.eslintignore --config ../../.config/.eslintrc.js lib", "test": "ts-node test/index.ts", "build": "tsc && gen-esm-wrapper . ./dist/index.mjs", "build:typecheck": "tsc --noEmit", - "prepublishOnly": "rimraf dist/ && rimraf types/ && pnpm run build" + "prepublishOnly": "rimraf dist/ && rimraf types/ && bun run build" }, "devDependencies": { "dotenv": "^16.0.3", @@ -70,4 +69,4 @@ "url": "https://github.com/zaida04/guilded.js/issues" }, "gitHead": "eee38a19e0bfa812d7136cc78a6bc99e0b402b0c" -} +} \ No newline at end of file diff --git a/packages/gil/test/index.ts b/packages/gil/test/index.ts index b105fe63..6e2fe335 100644 --- a/packages/gil/test/index.ts +++ b/packages/gil/test/index.ts @@ -5,9 +5,9 @@ import { BotClient } from "../lib"; config({ path: join(__dirname, "..", ".env") }); const bot = new BotClient({ - token: process.env.TOKEN!, - prefix: ".", - sourceFolderPath: __dirname, + token: process.env.TOKEN!, + prefix: ".", + sourceFolderPath: __dirname, }); bot.login(); diff --git a/packages/guilded.js/lib/cache.ts b/packages/guilded.js/lib/cache.ts index 3f1acee5..97645298 100644 --- a/packages/guilded.js/lib/cache.ts +++ b/packages/guilded.js/lib/cache.ts @@ -1,32 +1,37 @@ import { Collection } from "@discordjs/collection"; export type CacheStructure = { - get(key: K): Promise | V; - set(key: K, value: V): Promise | void; - delete(key: K): Promise | void; + get(key: K): Promise | V; + set(key: K, value: V): Promise | void; + delete(key: K): Promise | void; }; /** * A collection with a max cap size, which will remove a random element */ export class CacheCollection extends Collection { - public maxSize: number; + public maxSize: number; - public constructor(options?: { maxSize?: number }, entries?: readonly (readonly [K, V])[] | null | undefined) { - super(entries); - if (options?.maxSize !== undefined && options.maxSize < 1) { - throw new TypeError("Cannot pass 0 or negative value as maxSize."); - } + public constructor( + options?: { + maxSize?: number; + }, + entries?: readonly (readonly [K, V])[] | null | undefined, + ) { + super(entries); + if (options?.maxSize !== undefined && options.maxSize < 1) { + throw new TypeError("Cannot pass 0 or negative value as maxSize."); + } - this.maxSize = options?.maxSize ?? Number.POSITIVE_INFINITY; - } + this.maxSize = options?.maxSize ?? Number.POSITIVE_INFINITY; + } - public set(...args: Parameters<(typeof Collection.prototype)["set"]>): this { - if (this.size >= this.maxSize) this.delete(this.firstKey()!); - return super.set(...args); - } + public set(...args: Parameters<(typeof Collection.prototype)["set"]>): this { + if (this.size >= this.maxSize) this.delete(this.firstKey()!); + return super.set(...args); + } } export function inMemoryCacheBuilder(_structName: string, _struct: T): CacheCollection { - return new CacheCollection(); + return new CacheCollection(); } diff --git a/packages/guilded.js/lib/constants.ts b/packages/guilded.js/lib/constants.ts index 3bd43f91..6122bf06 100644 --- a/packages/guilded.js/lib/constants.ts +++ b/packages/guilded.js/lib/constants.ts @@ -1,48 +1,48 @@ export const constants = { - clientEvents: { - CALENDAR_EVENT_CREATED: "calendarEventCreated", - CALENDAR_EVENT_UPDATED: "calendarEventUpdated", - CALENDAR_EVENT_DELETED: "calendarEventDeleted", - CALENDAR_EVENT_RSVP_UPDATED: "calendarRsvpUpdated", - CALENDAR_EVENT_RSVP_MANY_UPDATED: "calendarRsvpManyUpdated", - CALENDAR_EVENT_RSVP_DELETED: "calendarRsvpDeleted", - MESSAGE_CREATED: "messageCreated", - MESSAGE_UPDATED: "messageUpdated", - MESSAGE_DELETED: "messageDeleted", - MEMBER_UPDATED: "memberUpdated", - ROLES_UPATED: "rolesUpdated", - MEMBER_JOINED: "memberJoined", - MEMBER_REMOVED: "memberRemoved", - MEMBER_BANNED: "memberBanned", - MEMBER_UNBANNED: "memberUnbanned", - MEMBER_SOCIAL_LINK_CREATED: "memberSocialLinkCreated", - MEMBER_SOCIAL_LINK_UPDATED: "memberSocialLinkUpdated", - MEMBER_SOCIAL_LINK_DELETED: "memberSocialLinkDeleted", - WEBHOOK_CREATED: "webhookCreated", - WEBHOOK_UPDATED: "webhookUpdated", - LIST_ITEM_COMPLETED: "listItemCompleted", - LIST_ITEM_UNCOMPLETED: "listItemUncompleted", - LIST_ITEM_CREATED: "listItemCreated", - LIST_ITEM_UPDATED: "listItemUpdated", - LIST_ITEM_DELETED: "listItemDeleted", - CHANNEL_CREATED: "channelCreated", - CHANNEL_UPDATED: "channelUpdated", - CHANNEL_DELETED: "channelDeleted", - DOC_CREATED: "docCreated", - DOC_UPDATED: "docUpdated", - DOC_DELETED: "docDeleted", - SERVER_CREATED: "serverCreated", - BOT_SERVER_CREATED: "botServerCreated", - BOT_SERVER_DELETED: "botServerDeleted", - MESSAGE_REACTION_CREATED: "messageReactionCreated", - MESSAGE_REACTION_DELETED: "messageReactionDeleted", - FORUM_TOPIC_CREATED: "forumTopicCreated", - FORUM_TOPIC_DELETED: "forumTopicDeleted", - FORUM_TOPIC_UPDATED: "forumTopicUpdated", - FORUM_TOPIC_PINNED: "forumTopicPinned", - FORUM_TOPIC_UNPINNED: "forumTopicUnpinned", - FORUM_TOPIC_LOCKED: "forumTopicLocked", - FORUM_TOPIC_UNLOCKED: "forumTopicUnlocked", - }, + clientEvents: { + CALENDAR_EVENT_CREATED: "calendarEventCreated", + CALENDAR_EVENT_UPDATED: "calendarEventUpdated", + CALENDAR_EVENT_DELETED: "calendarEventDeleted", + CALENDAR_EVENT_RSVP_UPDATED: "calendarRsvpUpdated", + CALENDAR_EVENT_RSVP_MANY_UPDATED: "calendarRsvpManyUpdated", + CALENDAR_EVENT_RSVP_DELETED: "calendarRsvpDeleted", + MESSAGE_CREATED: "messageCreated", + MESSAGE_UPDATED: "messageUpdated", + MESSAGE_DELETED: "messageDeleted", + MEMBER_UPDATED: "memberUpdated", + ROLES_UPATED: "rolesUpdated", + MEMBER_JOINED: "memberJoined", + MEMBER_REMOVED: "memberRemoved", + MEMBER_BANNED: "memberBanned", + MEMBER_UNBANNED: "memberUnbanned", + MEMBER_SOCIAL_LINK_CREATED: "memberSocialLinkCreated", + MEMBER_SOCIAL_LINK_UPDATED: "memberSocialLinkUpdated", + MEMBER_SOCIAL_LINK_DELETED: "memberSocialLinkDeleted", + WEBHOOK_CREATED: "webhookCreated", + WEBHOOK_UPDATED: "webhookUpdated", + LIST_ITEM_COMPLETED: "listItemCompleted", + LIST_ITEM_UNCOMPLETED: "listItemUncompleted", + LIST_ITEM_CREATED: "listItemCreated", + LIST_ITEM_UPDATED: "listItemUpdated", + LIST_ITEM_DELETED: "listItemDeleted", + CHANNEL_CREATED: "channelCreated", + CHANNEL_UPDATED: "channelUpdated", + CHANNEL_DELETED: "channelDeleted", + DOC_CREATED: "docCreated", + DOC_UPDATED: "docUpdated", + DOC_DELETED: "docDeleted", + SERVER_CREATED: "serverCreated", + BOT_SERVER_CREATED: "botServerCreated", + BOT_SERVER_DELETED: "botServerDeleted", + MESSAGE_REACTION_CREATED: "messageReactionCreated", + MESSAGE_REACTION_DELETED: "messageReactionDeleted", + FORUM_TOPIC_CREATED: "forumTopicCreated", + FORUM_TOPIC_DELETED: "forumTopicDeleted", + FORUM_TOPIC_UPDATED: "forumTopicUpdated", + FORUM_TOPIC_PINNED: "forumTopicPinned", + FORUM_TOPIC_UNPINNED: "forumTopicUnpinned", + FORUM_TOPIC_LOCKED: "forumTopicLocked", + FORUM_TOPIC_UNLOCKED: "forumTopicUnlocked", + }, } as const; export type ClientEvent = typeof constants.clientEvents; diff --git a/packages/guilded.js/lib/events.ts b/packages/guilded.js/lib/events.ts index 0e11f1b3..41fe2a4b 100644 --- a/packages/guilded.js/lib/events.ts +++ b/packages/guilded.js/lib/events.ts @@ -2,38 +2,38 @@ import type { EmotePayload, UserSummaryPayload } from "@guildedjs/api"; import type { Member } from "./structures"; export type ServerEvent = { - serverId: string; + serverId: string; }; export type MemberUnbannedEvent = ServerEvent & { - createdAt: string; - createdBy: string; - reason?: string; - user: UserSummaryPayload; + createdAt: string; + createdBy: string; + reason?: string; + user: UserSummaryPayload; }; export type MemberRemovedEvent = ServerEvent & { - isBan?: boolean; - isKick?: boolean; - userId: string; + isBan?: boolean; + isKick?: boolean; + userId: string; }; export type MemberUpdatedEvent = ServerEvent & { - userId: string; - nickname: string | null; - oldMember: Member | null; + userId: string; + nickname: string | null; + oldMember: Member | null; }; export type MessageReactionDeletedEvent = ServerEvent & { - channelId: string; - createdBy: string; - emote: EmotePayload; - messageId: string; + channelId: string; + createdBy: string; + emote: EmotePayload; + messageId: string; }; export type MessageDeletedEvent = ServerEvent & { - channelId: string; - deletedAt: string; - id: string; - isPrivate?: boolean; + channelId: string; + deletedAt: string; + id: string; + isPrivate?: boolean; }; diff --git a/packages/guilded.js/lib/gateway/ClientGatewayHandler.ts b/packages/guilded.js/lib/gateway/ClientGatewayHandler.ts index eb4645cf..b759ca93 100644 --- a/packages/guilded.js/lib/gateway/ClientGatewayHandler.ts +++ b/packages/guilded.js/lib/gateway/ClientGatewayHandler.ts @@ -14,86 +14,86 @@ import { ServerMemberEventHandler } from "./handler/ServerMemberEventHandler"; import { ServerWebhookEventHandler } from "./handler/ServerWebhookEventHandler"; export class ClientGatewayHandler { - calendarEventHandler = new CalendarEventHandler(this.client); - - calendarEventRsvpHandler = new CalendarEventRsvpHandler(this.client); - - messageHandler = new MessageEventHandler(this.client); - - ServerHandler = new ServerEventHandler(this.client); - - ServerMemberHandler = new ServerMemberEventHandler(this.client); - - ServerWebhookHandler = new ServerWebhookEventHandler(this.client); - - listHandler = new ListEventHandler(this.client); - - ServerChannelHandler = new ServerChannelEventHandler(this.client); - - docHandler = new DocEventHandler(this.client); - - reactionHandler = new ReactionEventHandler(this.client); - - forumHandler = new ForumEventHandler(this.client); - - botHandler = new BotEventHandler(this.client); - - readonly eventToHandlerMap: Record Promise | boolean> = { - [WebSocketEvents.CalendarEventCreated]: (data) => this.calendarEventHandler.calendarEventCreated(data as WSPacket<"CalendarEventCreated">), - [WebSocketEvents.CalendarEventDeleted]: (data) => this.calendarEventHandler.calendarEventDeleted(data as WSPacket<"CalendarEventDeleted">), - [WebSocketEvents.CalendarEventUpdated]: (data) => this.calendarEventHandler.calendarEventUpdated(data as WSPacket<"CalendarEventUpdated">), - [WebSocketEvents.CalendarEventRsvpUpdated]: (data) => this.calendarEventRsvpHandler.calendarEventRsvpUpdated(data as WSPacket<"CalendarEventRsvpUpdated">), - [WebSocketEvents.CalendarEventRsvpManyUpdated]: (data) => this.calendarEventRsvpHandler.calendarEventRsvpManyUpdated(data as WSPacket<"CalendarEventRsvpManyUpdated">), - [WebSocketEvents.CalendarEventRsvpDeleted]: (data) => this.calendarEventRsvpHandler.calendarEventRsvpDeleted(data as WSPacket<"CalendarEventRsvpDeleted">), - [WebSocketEvents.ChatMessageCreated]: (data) => this.messageHandler.messageCreated(data as WSPacket<"ChatMessageCreated">), - [WebSocketEvents.ChatMessageDeleted]: (data) => this.messageHandler.messageDeleted(data as WSPacket<"ChatMessageDeleted">), - [WebSocketEvents.ChatMessageUpdated]: (data) => this.messageHandler.messageUpdated(data as WSPacket<"ChatMessageUpdated">), - [WebSocketEvents.ServerMemberJoined]: (data) => this.ServerMemberHandler.serverMemberJoined(data as WSPacket<"ServerMemberJoined">), - [WebSocketEvents.ServerMemberRemoved]: (data) => this.ServerMemberHandler.serverMemberRemoved(data as WSPacket<"ServerMemberRemoved">), - [WebSocketEvents.ServerMemberUpdated]: (data) => this.ServerMemberHandler.serverMemberUpdated(data as WSPacket<"ServerMemberUpdated">), - [WebSocketEvents.ServerRolesUpdated]: (data) => this.ServerHandler.serverRolesUpdated(data as WSPacket<"ServerRolesUpdated">), - [WebSocketEvents.ServerMemberBanned]: (data) => this.ServerMemberHandler.serverMemberBanned(data as WSPacket<"ServerMemberBanned">), - [WebSocketEvents.ServerMemberUnbanned]: (data) => this.ServerMemberHandler.serverMemberUnbanned(data as WSPacket<"ServerMemberUnbanned">), - [WebSocketEvents.ServerMemberSocialLinkCreated]: (data) => this.ServerMemberHandler.serverMemberSocialLinkCreated(data as WSPacket<"ServerMemberSocialLinkCreated">), - [WebSocketEvents.ServerMemberSocialLinkUpdated]: (data) => this.ServerMemberHandler.serverMemberSocialLinkUpdated(data as WSPacket<"ServerMemberSocialLinkUpdated">), - [WebSocketEvents.ServerMemberSocialLinkDeleted]: (data) => this.ServerMemberHandler.serverMemberSocialLinkDeleted(data as WSPacket<"ServerMemberSocialLinkDeleted">), - [WebSocketEvents.ServerWebhookCreated]: (data) => this.ServerWebhookHandler.serverWebhookCreated(data as WSPacket<"ServerWebhookCreated">), - [WebSocketEvents.ServerWebhookUpdated]: (data) => this.ServerWebhookHandler.serverWebhookUpdated(data as WSPacket<"ServerWebhookUpdated">), - [WebSocketEvents.BotServerMembershipCreated]: (data) => this.botHandler.botServerMembershipCreated(data as WSPacket<"BotServerMembershipCreated">), - [WebSocketEvents.BotServerMembershipDeleted]: (data) => this.botHandler.botServerMembershipDeleted(data as WSPacket<"BotServerMembershipDeleted">), - [WebSocketEvents.ListItemCompleted]: (data) => this.listHandler.listItemCompleted(data as WSPacket<"ListItemCompleted">), - [WebSocketEvents.ListItemUncompleted]: (data) => this.listHandler.listItemUncompleted(data as WSPacket<"ListItemUncompleted">), - [WebSocketEvents.ListItemCreated]: (data) => this.listHandler.listItemCreated(data as WSPacket<"ListItemCreated">), - [WebSocketEvents.ListItemUpdated]: (data) => this.listHandler.listItemUpdated(data as WSPacket<"ListItemUpdated">), - [WebSocketEvents.ListItemDeleted]: (data) => this.listHandler.listItemDeleted(data as WSPacket<"ListItemDeleted">), - [WebSocketEvents.DocCreated]: (data) => this.docHandler.docCreated(data as WSPacket<"DocCreated">), - [WebSocketEvents.DocDeleted]: (data) => this.docHandler.docDeleted(data as WSPacket<"DocDeleted">), - [WebSocketEvents.DocUpdated]: (data) => this.docHandler.docUpdated(data as WSPacket<"DocUpdated">), - [WebSocketEvents.ServerChannelCreated]: (data) => this.ServerChannelHandler.serverChannelCreated(data as WSPacket<"ServerChannelCreated">), - [WebSocketEvents.ServerChannelDeleted]: (data) => this.ServerChannelHandler.serverChannelDeleted(data as WSPacket<"ServerChannelDeleted">), - [WebSocketEvents.ServerChannelUpdated]: (data) => this.ServerChannelHandler.serverChannelUpdated(data as WSPacket<"ServerChannelUpdated">), - [WebSocketEvents.ChannelMessageReactionCreated]: (data) => this.reactionHandler.messageReactionCreated(data as WSPacket<"ChannelMessageReactionCreated">), - [WebSocketEvents.ChannelMessageReactionDeleted]: (data) => this.reactionHandler.messageReactionDeleted(data as WSPacket<"ChannelMessageReactionDeleted">), - [WebSocketEvents.ForumTopicCreated]: (data) => this.forumHandler.forumTopicCreated(data as WSPacket<"ForumTopicCreated">), - [WebSocketEvents.ForumTopicDeleted]: (data) => this.forumHandler.forumTopicDeleted(data as WSPacket<"ForumTopicDeleted">), - [WebSocketEvents.ForumTopicUpdated]: (data) => this.forumHandler.forumTopicUpdated(data as WSPacket<"ForumTopicUpdated">), - [WebSocketEvents.ForumTopicPinned]: (data) => this.forumHandler.forumTopicPinned(data as WSPacket<"ForumTopicPinned">), - [WebSocketEvents.ForumTopicUnpinned]: (data) => this.forumHandler.forumTopicUnpinned(data as WSPacket<"ForumTopicUnpinned">), - [WebSocketEvents.ForumTopicLocked]: (data) => this.forumHandler.forumTopicLocked(data as WSPacket<"ForumTopicLocked">), - [WebSocketEvents.ForumTopicUnlocked]: (data) => this.forumHandler.forumTopicUnlocked(data as WSPacket<"ForumTopicUnlocked">), - }; - - constructor(public readonly client: Client) {} - - handleWSMessage(event: keyof WSEvent, data: SkeletonWSPayload): void { - const discardEventOption = this.client.options.gateway?.discardEvent; - if (discardEventOption?.(event, data)) return; - - const existingEvent = this.eventToHandlerMap[event]; - if (existingEvent) { - void existingEvent(data); - } else { - this.client.emit("unknownGatewayEvent", data); - } - } + calendarEventHandler = new CalendarEventHandler(this.client); + + calendarEventRsvpHandler = new CalendarEventRsvpHandler(this.client); + + messageHandler = new MessageEventHandler(this.client); + + ServerHandler = new ServerEventHandler(this.client); + + ServerMemberHandler = new ServerMemberEventHandler(this.client); + + ServerWebhookHandler = new ServerWebhookEventHandler(this.client); + + listHandler = new ListEventHandler(this.client); + + ServerChannelHandler = new ServerChannelEventHandler(this.client); + + docHandler = new DocEventHandler(this.client); + + reactionHandler = new ReactionEventHandler(this.client); + + forumHandler = new ForumEventHandler(this.client); + + botHandler = new BotEventHandler(this.client); + + readonly eventToHandlerMap: Record Promise | boolean> = { + [WebSocketEvents.CalendarEventCreated]: (data) => this.calendarEventHandler.calendarEventCreated(data as WSPacket<"CalendarEventCreated">), + [WebSocketEvents.CalendarEventDeleted]: (data) => this.calendarEventHandler.calendarEventDeleted(data as WSPacket<"CalendarEventDeleted">), + [WebSocketEvents.CalendarEventUpdated]: (data) => this.calendarEventHandler.calendarEventUpdated(data as WSPacket<"CalendarEventUpdated">), + [WebSocketEvents.CalendarEventRsvpUpdated]: (data) => this.calendarEventRsvpHandler.calendarEventRsvpUpdated(data as WSPacket<"CalendarEventRsvpUpdated">), + [WebSocketEvents.CalendarEventRsvpManyUpdated]: (data) => this.calendarEventRsvpHandler.calendarEventRsvpManyUpdated(data as WSPacket<"CalendarEventRsvpManyUpdated">), + [WebSocketEvents.CalendarEventRsvpDeleted]: (data) => this.calendarEventRsvpHandler.calendarEventRsvpDeleted(data as WSPacket<"CalendarEventRsvpDeleted">), + [WebSocketEvents.ChatMessageCreated]: (data) => this.messageHandler.messageCreated(data as WSPacket<"ChatMessageCreated">), + [WebSocketEvents.ChatMessageDeleted]: (data) => this.messageHandler.messageDeleted(data as WSPacket<"ChatMessageDeleted">), + [WebSocketEvents.ChatMessageUpdated]: (data) => this.messageHandler.messageUpdated(data as WSPacket<"ChatMessageUpdated">), + [WebSocketEvents.ServerMemberJoined]: (data) => this.ServerMemberHandler.serverMemberJoined(data as WSPacket<"ServerMemberJoined">), + [WebSocketEvents.ServerMemberRemoved]: (data) => this.ServerMemberHandler.serverMemberRemoved(data as WSPacket<"ServerMemberRemoved">), + [WebSocketEvents.ServerMemberUpdated]: (data) => this.ServerMemberHandler.serverMemberUpdated(data as WSPacket<"ServerMemberUpdated">), + [WebSocketEvents.ServerRolesUpdated]: (data) => this.ServerHandler.serverRolesUpdated(data as WSPacket<"ServerRolesUpdated">), + [WebSocketEvents.ServerMemberBanned]: (data) => this.ServerMemberHandler.serverMemberBanned(data as WSPacket<"ServerMemberBanned">), + [WebSocketEvents.ServerMemberUnbanned]: (data) => this.ServerMemberHandler.serverMemberUnbanned(data as WSPacket<"ServerMemberUnbanned">), + [WebSocketEvents.ServerMemberSocialLinkCreated]: (data) => this.ServerMemberHandler.serverMemberSocialLinkCreated(data as WSPacket<"ServerMemberSocialLinkCreated">), + [WebSocketEvents.ServerMemberSocialLinkUpdated]: (data) => this.ServerMemberHandler.serverMemberSocialLinkUpdated(data as WSPacket<"ServerMemberSocialLinkUpdated">), + [WebSocketEvents.ServerMemberSocialLinkDeleted]: (data) => this.ServerMemberHandler.serverMemberSocialLinkDeleted(data as WSPacket<"ServerMemberSocialLinkDeleted">), + [WebSocketEvents.ServerWebhookCreated]: (data) => this.ServerWebhookHandler.serverWebhookCreated(data as WSPacket<"ServerWebhookCreated">), + [WebSocketEvents.ServerWebhookUpdated]: (data) => this.ServerWebhookHandler.serverWebhookUpdated(data as WSPacket<"ServerWebhookUpdated">), + [WebSocketEvents.BotServerMembershipCreated]: (data) => this.botHandler.botServerMembershipCreated(data as WSPacket<"BotServerMembershipCreated">), + [WebSocketEvents.BotServerMembershipDeleted]: (data) => this.botHandler.botServerMembershipDeleted(data as WSPacket<"BotServerMembershipDeleted">), + [WebSocketEvents.ListItemCompleted]: (data) => this.listHandler.listItemCompleted(data as WSPacket<"ListItemCompleted">), + [WebSocketEvents.ListItemUncompleted]: (data) => this.listHandler.listItemUncompleted(data as WSPacket<"ListItemUncompleted">), + [WebSocketEvents.ListItemCreated]: (data) => this.listHandler.listItemCreated(data as WSPacket<"ListItemCreated">), + [WebSocketEvents.ListItemUpdated]: (data) => this.listHandler.listItemUpdated(data as WSPacket<"ListItemUpdated">), + [WebSocketEvents.ListItemDeleted]: (data) => this.listHandler.listItemDeleted(data as WSPacket<"ListItemDeleted">), + [WebSocketEvents.DocCreated]: (data) => this.docHandler.docCreated(data as WSPacket<"DocCreated">), + [WebSocketEvents.DocDeleted]: (data) => this.docHandler.docDeleted(data as WSPacket<"DocDeleted">), + [WebSocketEvents.DocUpdated]: (data) => this.docHandler.docUpdated(data as WSPacket<"DocUpdated">), + [WebSocketEvents.ServerChannelCreated]: (data) => this.ServerChannelHandler.serverChannelCreated(data as WSPacket<"ServerChannelCreated">), + [WebSocketEvents.ServerChannelDeleted]: (data) => this.ServerChannelHandler.serverChannelDeleted(data as WSPacket<"ServerChannelDeleted">), + [WebSocketEvents.ServerChannelUpdated]: (data) => this.ServerChannelHandler.serverChannelUpdated(data as WSPacket<"ServerChannelUpdated">), + [WebSocketEvents.ChannelMessageReactionCreated]: (data) => this.reactionHandler.messageReactionCreated(data as WSPacket<"ChannelMessageReactionCreated">), + [WebSocketEvents.ChannelMessageReactionDeleted]: (data) => this.reactionHandler.messageReactionDeleted(data as WSPacket<"ChannelMessageReactionDeleted">), + [WebSocketEvents.ForumTopicCreated]: (data) => this.forumHandler.forumTopicCreated(data as WSPacket<"ForumTopicCreated">), + [WebSocketEvents.ForumTopicDeleted]: (data) => this.forumHandler.forumTopicDeleted(data as WSPacket<"ForumTopicDeleted">), + [WebSocketEvents.ForumTopicUpdated]: (data) => this.forumHandler.forumTopicUpdated(data as WSPacket<"ForumTopicUpdated">), + [WebSocketEvents.ForumTopicPinned]: (data) => this.forumHandler.forumTopicPinned(data as WSPacket<"ForumTopicPinned">), + [WebSocketEvents.ForumTopicUnpinned]: (data) => this.forumHandler.forumTopicUnpinned(data as WSPacket<"ForumTopicUnpinned">), + [WebSocketEvents.ForumTopicLocked]: (data) => this.forumHandler.forumTopicLocked(data as WSPacket<"ForumTopicLocked">), + [WebSocketEvents.ForumTopicUnlocked]: (data) => this.forumHandler.forumTopicUnlocked(data as WSPacket<"ForumTopicUnlocked">), + }; + + constructor(public readonly client: Client) {} + + handleWSMessage(event: keyof WSEvent, data: SkeletonWSPayload): void { + const discardEventOption = this.client.options.gateway?.discardEvent; + if (discardEventOption?.(event, data)) return; + + const existingEvent = this.eventToHandlerMap[event]; + if (existingEvent) { + void existingEvent(data); + } else { + this.client.emit("unknownGatewayEvent", data); + } + } } diff --git a/packages/guilded.js/lib/gateway/handler/BotEventHandler.ts b/packages/guilded.js/lib/gateway/handler/BotEventHandler.ts index 2d914241..c967fd50 100644 --- a/packages/guilded.js/lib/gateway/handler/BotEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/BotEventHandler.ts @@ -5,15 +5,15 @@ import { Server } from "../../structures/Server"; import { GatewayEventHandler } from "./GatewayEventHandler"; export class BotEventHandler extends GatewayEventHandler { - botServerMembershipCreated(data: WSPacket<"BotServerMembershipCreated">): boolean { - const server = this.client.servers.cache.get(data.d.server.id)?._update(data.d.server) ?? new Server(this.client, data.d.server); + botServerMembershipCreated(data: WSPacket<"BotServerMembershipCreated">): boolean { + const server = this.client.servers.cache.get(data.d.server.id)?._update(data.d.server) ?? new Server(this.client, data.d.server); - return this.client.emit(constants.clientEvents.BOT_SERVER_CREATED, server, data.d.createdBy); - } + return this.client.emit(constants.clientEvents.BOT_SERVER_CREATED, server, data.d.createdBy); + } - botServerMembershipDeleted(data: WSPacket<"BotServerMembershipDeleted">): boolean { - const server = this.client.servers.cache.get(data.d.server.id)?._update(data.d.server) ?? new Server(this.client, data.d.server); + botServerMembershipDeleted(data: WSPacket<"BotServerMembershipDeleted">): boolean { + const server = this.client.servers.cache.get(data.d.server.id)?._update(data.d.server) ?? new Server(this.client, data.d.server); - return this.client.emit(constants.clientEvents.BOT_SERVER_DELETED, server, data.d.deletedBy); - } + return this.client.emit(constants.clientEvents.BOT_SERVER_DELETED, server, data.d.deletedBy); + } } diff --git a/packages/guilded.js/lib/gateway/handler/CalendarEventHandler.ts b/packages/guilded.js/lib/gateway/handler/CalendarEventHandler.ts index 93333601..c6c60eea 100644 --- a/packages/guilded.js/lib/gateway/handler/CalendarEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/CalendarEventHandler.ts @@ -5,68 +5,68 @@ import { CalendarEvent, CalendarEventRsvp } from "../../structures/CalendarEvent import { GatewayEventHandler } from "./GatewayEventHandler"; export class CalendarEventHandler extends GatewayEventHandler { - calendarEventCreated(data: WSPacket<"CalendarEventCreated">): boolean { - const existingCalendar = this.client.calendars.cache.get(data.d.calendarEvent.id); - if (existingCalendar) return this.client.emit(constants.clientEvents.CALENDAR_EVENT_CREATED, existingCalendar); + calendarEventCreated(data: WSPacket<"CalendarEventCreated">): boolean { + const existingCalendar = this.client.calendars.cache.get(data.d.calendarEvent.id); + if (existingCalendar) return this.client.emit(constants.clientEvents.CALENDAR_EVENT_CREATED, existingCalendar); - const newCalendarEvent = new CalendarEvent(this.client, data.d.calendarEvent); - if (this.client.calendars.shouldCacheCalendar) this.client.calendars.cache.set(newCalendarEvent.id, newCalendarEvent); - return this.client.emit(constants.clientEvents.CALENDAR_EVENT_CREATED, newCalendarEvent); - } + const newCalendarEvent = new CalendarEvent(this.client, data.d.calendarEvent); + if (this.client.calendars.shouldCacheCalendar) this.client.calendars.cache.set(newCalendarEvent.id, newCalendarEvent); + return this.client.emit(constants.clientEvents.CALENDAR_EVENT_CREATED, newCalendarEvent); + } - calendarEventUpdated(data: WSPacket<"CalendarEventUpdated">): boolean { - const existingCalendar = this.client.calendars.cache.get(data.d.calendarEvent.id); - const oldCalendar = existingCalendar?._clone(); - const updatedCalendar = existingCalendar?._update(data.d.calendarEvent) ?? new CalendarEvent(this.client, data.d.calendarEvent); - if (this.client.calendars.shouldCacheCalendar && !existingCalendar) this.client.calendars.cache.set(updatedCalendar.id, updatedCalendar); - return this.client.emit(constants.clientEvents.CALENDAR_EVENT_UPDATED, updatedCalendar, oldCalendar ?? null); - } + calendarEventUpdated(data: WSPacket<"CalendarEventUpdated">): boolean { + const existingCalendar = this.client.calendars.cache.get(data.d.calendarEvent.id); + const oldCalendar = existingCalendar?._clone(); + const updatedCalendar = existingCalendar?._update(data.d.calendarEvent) ?? new CalendarEvent(this.client, data.d.calendarEvent); + if (this.client.calendars.shouldCacheCalendar && !existingCalendar) this.client.calendars.cache.set(updatedCalendar.id, updatedCalendar); + return this.client.emit(constants.clientEvents.CALENDAR_EVENT_UPDATED, updatedCalendar, oldCalendar ?? null); + } - calendarEventDeleted(data: WSPacket<"CalendarEventDeleted">): boolean { - const existingCalendar = this.client.calendars.cache.get(data.d.calendarEvent.id); - const deletedCalendar = existingCalendar?._update(data.d.calendarEvent) ?? new CalendarEvent(this.client, data.d.calendarEvent); - if (this.client.options.cache?.removeCalendarsOnDelete) this.client.calendars.cache.delete(deletedCalendar.id); - return this.client.emit(constants.clientEvents.CALENDAR_EVENT_DELETED, deletedCalendar); - } + calendarEventDeleted(data: WSPacket<"CalendarEventDeleted">): boolean { + const existingCalendar = this.client.calendars.cache.get(data.d.calendarEvent.id); + const deletedCalendar = existingCalendar?._update(data.d.calendarEvent) ?? new CalendarEvent(this.client, data.d.calendarEvent); + if (this.client.options.cache?.removeCalendarsOnDelete) this.client.calendars.cache.delete(deletedCalendar.id); + return this.client.emit(constants.clientEvents.CALENDAR_EVENT_DELETED, deletedCalendar); + } } export class CalendarEventRsvpHandler extends GatewayEventHandler { - calendarEventRsvpUpdated(data: WSPacket<"CalendarEventRsvpUpdated">): boolean { - const existingCalendar = this.client.calendars.cache.get(data.d.calendarEventRsvp.calendarEventId); - const existingCalendarRsvp = existingCalendar?.rsvps?.get(data.d.calendarEventRsvp.userId); + calendarEventRsvpUpdated(data: WSPacket<"CalendarEventRsvpUpdated">): boolean { + const existingCalendar = this.client.calendars.cache.get(data.d.calendarEventRsvp.calendarEventId); + const existingCalendarRsvp = existingCalendar?.rsvps?.get(data.d.calendarEventRsvp.userId); - const oldCalendarRsvp = existingCalendarRsvp?._clone(); - const updatedCalendarRsvp = existingCalendarRsvp?._update(data.d.calendarEventRsvp) ?? new CalendarEventRsvp(this.client, data.d.calendarEventRsvp); + const oldCalendarRsvp = existingCalendarRsvp?._clone(); + const updatedCalendarRsvp = existingCalendarRsvp?._update(data.d.calendarEventRsvp) ?? new CalendarEventRsvp(this.client, data.d.calendarEventRsvp); - if (this.client.calendars.shouldCacheCalendar && this.client.calendars.shouldCacheCalendarRsvps && !existingCalendarRsvp) - existingCalendar?.rsvps?.set(updatedCalendarRsvp.userId, updatedCalendarRsvp); - return this.client.emit(constants.clientEvents.CALENDAR_EVENT_RSVP_UPDATED, updatedCalendarRsvp, oldCalendarRsvp ?? null); - } + if (this.client.calendars.shouldCacheCalendar && this.client.calendars.shouldCacheCalendarRsvps && !existingCalendarRsvp) + existingCalendar?.rsvps?.set(updatedCalendarRsvp.userId, updatedCalendarRsvp); + return this.client.emit(constants.clientEvents.CALENDAR_EVENT_RSVP_UPDATED, updatedCalendarRsvp, oldCalendarRsvp ?? null); + } - calendarEventRsvpManyUpdated(data: WSPacket<"CalendarEventRsvpManyUpdated">): boolean { - const rsvpCollection = new Collection(); - for (const rsvp of data.d.calendarEventRsvps) { - const existingCalendar = this.client.calendars.cache.get(rsvp.calendarEventId); - const existingCalendarRsvp = existingCalendar?.rsvps?.get(rsvp.userId); - const newCalendarRsvp = existingCalendarRsvp?._update(rsvp) ?? new CalendarEventRsvp(this.client, rsvp); - rsvpCollection.set(rsvp.userId, newCalendarRsvp); - if (this.client.calendars.shouldCacheCalendar && this.client.calendars.shouldCacheCalendarRsvps && !existingCalendarRsvp) { - existingCalendar?.rsvps?.set(rsvp.userId, newCalendarRsvp); - } - } + calendarEventRsvpManyUpdated(data: WSPacket<"CalendarEventRsvpManyUpdated">): boolean { + const rsvpCollection = new Collection(); + for (const rsvp of data.d.calendarEventRsvps) { + const existingCalendar = this.client.calendars.cache.get(rsvp.calendarEventId); + const existingCalendarRsvp = existingCalendar?.rsvps?.get(rsvp.userId); + const newCalendarRsvp = existingCalendarRsvp?._update(rsvp) ?? new CalendarEventRsvp(this.client, rsvp); + rsvpCollection.set(rsvp.userId, newCalendarRsvp); + if (this.client.calendars.shouldCacheCalendar && this.client.calendars.shouldCacheCalendarRsvps && !existingCalendarRsvp) { + existingCalendar?.rsvps?.set(rsvp.userId, newCalendarRsvp); + } + } - return this.client.emit(constants.clientEvents.CALENDAR_EVENT_RSVP_MANY_UPDATED, rsvpCollection); - } + return this.client.emit(constants.clientEvents.CALENDAR_EVENT_RSVP_MANY_UPDATED, rsvpCollection); + } - calendarEventRsvpDeleted(data: WSPacket<"CalendarEventRsvpDeleted">): boolean { - const existingCalendar = this.client.calendars.cache.get(data.d.calendarEventRsvp.calendarEventId); - const existingCalendarRsvp = existingCalendar?.rsvps?.get(data.d.calendarEventRsvp.userId); - const deletedCalendarRsvp = existingCalendarRsvp?._update(data.d.calendarEventRsvp) ?? new CalendarEventRsvp(this.client, data.d.calendarEventRsvp); - if (this.client.options.cache?.removeCalendarRsvpOnDelete) { - const currentCalendar = this.client.calendars.cache.get(data.d.calendarEventRsvp.calendarEventId); - currentCalendar?.rsvps?.delete(data.d.calendarEventRsvp.userId); - } + calendarEventRsvpDeleted(data: WSPacket<"CalendarEventRsvpDeleted">): boolean { + const existingCalendar = this.client.calendars.cache.get(data.d.calendarEventRsvp.calendarEventId); + const existingCalendarRsvp = existingCalendar?.rsvps?.get(data.d.calendarEventRsvp.userId); + const deletedCalendarRsvp = existingCalendarRsvp?._update(data.d.calendarEventRsvp) ?? new CalendarEventRsvp(this.client, data.d.calendarEventRsvp); + if (this.client.options.cache?.removeCalendarRsvpOnDelete) { + const currentCalendar = this.client.calendars.cache.get(data.d.calendarEventRsvp.calendarEventId); + currentCalendar?.rsvps?.delete(data.d.calendarEventRsvp.userId); + } - return this.client.emit(constants.clientEvents.CALENDAR_EVENT_RSVP_DELETED, deletedCalendarRsvp); - } + return this.client.emit(constants.clientEvents.CALENDAR_EVENT_RSVP_DELETED, deletedCalendarRsvp); + } } diff --git a/packages/guilded.js/lib/gateway/handler/DocEventHandler.ts b/packages/guilded.js/lib/gateway/handler/DocEventHandler.ts index 13004e8b..b7a8ebb8 100644 --- a/packages/guilded.js/lib/gateway/handler/DocEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/DocEventHandler.ts @@ -4,22 +4,22 @@ import type { DocChannel } from "../../structures"; import { GatewayEventHandler } from "./GatewayEventHandler"; export class DocEventHandler extends GatewayEventHandler { - docCreated(data: WSPacket<"DocCreated">): boolean { - const existingChannel = this.client.channels.cache.get(data.d.doc.channelId) as DocChannel | undefined; - if (existingChannel) existingChannel.docs.set(data.d.doc.id, data.d.doc); - return this.client.emit(constants.clientEvents.DOC_CREATED, data.d.doc); - } + docCreated(data: WSPacket<"DocCreated">): boolean { + const existingChannel = this.client.channels.cache.get(data.d.doc.channelId) as DocChannel | undefined; + if (existingChannel) existingChannel.docs.set(data.d.doc.id, data.d.doc); + return this.client.emit(constants.clientEvents.DOC_CREATED, data.d.doc); + } - docUpdated(data: WSPacket<"DocUpdated">): boolean { - const existingChannel = this.client.channels.cache.get(data.d.doc.channelId) as DocChannel | undefined; - const existingDoc = existingChannel?.docs.get(data.d.doc.id); - if (existingChannel) existingChannel.docs.set(data.d.doc.id, data.d.doc); - return this.client.emit(constants.clientEvents.DOC_UPDATED, data.d.doc, existingDoc ?? null); - } + docUpdated(data: WSPacket<"DocUpdated">): boolean { + const existingChannel = this.client.channels.cache.get(data.d.doc.channelId) as DocChannel | undefined; + const existingDoc = existingChannel?.docs.get(data.d.doc.id); + if (existingChannel) existingChannel.docs.set(data.d.doc.id, data.d.doc); + return this.client.emit(constants.clientEvents.DOC_UPDATED, data.d.doc, existingDoc ?? null); + } - docDeleted(data: WSPacket<"DocDeleted">): boolean { - const existingChannel = this.client.channels.cache.get(data.d.doc.channelId) as DocChannel | undefined; - if (existingChannel) existingChannel.docs.set(data.d.doc.id, data.d.doc); - return this.client.emit(constants.clientEvents.DOC_DELETED, data.d.doc); - } + docDeleted(data: WSPacket<"DocDeleted">): boolean { + const existingChannel = this.client.channels.cache.get(data.d.doc.channelId) as DocChannel | undefined; + if (existingChannel) existingChannel.docs.set(data.d.doc.id, data.d.doc); + return this.client.emit(constants.clientEvents.DOC_DELETED, data.d.doc); + } } diff --git a/packages/guilded.js/lib/gateway/handler/ForumEventHandler.ts b/packages/guilded.js/lib/gateway/handler/ForumEventHandler.ts index df960b96..634c235d 100644 --- a/packages/guilded.js/lib/gateway/handler/ForumEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/ForumEventHandler.ts @@ -4,55 +4,65 @@ import { ForumTopic } from "../../structures/Forum"; import { GatewayEventHandler } from "./GatewayEventHandler"; export class ForumEventHandler extends GatewayEventHandler { - forumTopicCreated(data: WSPacket<"ForumTopicCreated">): boolean { - // This is in the case that a REST request beats us to adding the topic in the cache. - const existingTopic = this.client.topics.cache.get(data.d.forumTopic.id); - if (existingTopic) return this.client.emit(constants.clientEvents.FORUM_TOPIC_CREATED, existingTopic); - - const newTopic = new ForumTopic(this.client, data.d.forumTopic); - if (this.client.topics.shouldCacheForumTopic) this.client.topics.cache.set(newTopic.id, newTopic); - return this.client.emit(constants.clientEvents.FORUM_TOPIC_CREATED, newTopic); - } - - forumTopicUpdated(data: WSPacket<"ForumTopicUpdated">): boolean { - const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); - if (!getCachedTopic) { - const newTopic = new ForumTopic(this.client, data.d.forumTopic); - return this.client.emit(constants.clientEvents.FORUM_TOPIC_UPDATED, newTopic, null); - } - - const frozenOldTopic = Object.freeze(getCachedTopic._clone()); - getCachedTopic._update(data.d.forumTopic); - return this.client.emit(constants.clientEvents.FORUM_TOPIC_UPDATED, getCachedTopic, frozenOldTopic); - } - - forumTopicDeleted(data: WSPacket<"ForumTopicDeleted">): boolean { - const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); - getCachedTopic?._update({ _deletedAt: new Date() }); - return this.client.emit(constants.clientEvents.FORUM_TOPIC_DELETED, getCachedTopic ?? new ForumTopic(this.client, data.d.forumTopic)); - } - - forumTopicPinned(data: WSPacket<"ForumTopicPinned">): boolean { - const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); - getCachedTopic?._update({ isPinned: true }); - return this.client.emit(constants.clientEvents.FORUM_TOPIC_PINNED, getCachedTopic ?? new ForumTopic(this.client, data.d.forumTopic)); - } - - forumTopicUnpinned(data: WSPacket<"ForumTopicUnpinned">): boolean { - const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); - getCachedTopic?._update({ isPinned: false }); - return this.client.emit(constants.clientEvents.FORUM_TOPIC_UNPINNED, getCachedTopic ?? new ForumTopic(this.client, data.d.forumTopic)); - } - - forumTopicLocked(data: WSPacket<"ForumTopicLocked">): boolean { - const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); - getCachedTopic?._update({ isLocked: true }); - return this.client.emit(constants.clientEvents.FORUM_TOPIC_LOCKED, getCachedTopic ?? new ForumTopic(this.client, data.d.forumTopic)); - } - - forumTopicUnlocked(data: WSPacket<"ForumTopicUnlocked">): boolean { - const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); - getCachedTopic?._update({ isLocked: false }); - return this.client.emit(constants.clientEvents.FORUM_TOPIC_UNLOCKED, getCachedTopic ?? new ForumTopic(this.client, data.d.forumTopic)); - } + forumTopicCreated(data: WSPacket<"ForumTopicCreated">): boolean { + // This is in the case that a REST request beats us to adding the topic in the cache. + const existingTopic = this.client.topics.cache.get(data.d.forumTopic.id); + if (existingTopic) return this.client.emit(constants.clientEvents.FORUM_TOPIC_CREATED, existingTopic); + + const newTopic = new ForumTopic(this.client, data.d.forumTopic); + if (this.client.topics.shouldCacheForumTopic) this.client.topics.cache.set(newTopic.id, newTopic); + return this.client.emit(constants.clientEvents.FORUM_TOPIC_CREATED, newTopic); + } + + forumTopicUpdated(data: WSPacket<"ForumTopicUpdated">): boolean { + const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); + if (!getCachedTopic) { + const newTopic = new ForumTopic(this.client, data.d.forumTopic); + return this.client.emit(constants.clientEvents.FORUM_TOPIC_UPDATED, newTopic, null); + } + + const frozenOldTopic = Object.freeze(getCachedTopic._clone()); + getCachedTopic._update(data.d.forumTopic); + return this.client.emit(constants.clientEvents.FORUM_TOPIC_UPDATED, getCachedTopic, frozenOldTopic); + } + + forumTopicDeleted(data: WSPacket<"ForumTopicDeleted">): boolean { + const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); + getCachedTopic?._update({ + _deletedAt: new Date(), + }); + return this.client.emit(constants.clientEvents.FORUM_TOPIC_DELETED, getCachedTopic ?? new ForumTopic(this.client, data.d.forumTopic)); + } + + forumTopicPinned(data: WSPacket<"ForumTopicPinned">): boolean { + const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); + getCachedTopic?._update({ + isPinned: true, + }); + return this.client.emit(constants.clientEvents.FORUM_TOPIC_PINNED, getCachedTopic ?? new ForumTopic(this.client, data.d.forumTopic)); + } + + forumTopicUnpinned(data: WSPacket<"ForumTopicUnpinned">): boolean { + const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); + getCachedTopic?._update({ + isPinned: false, + }); + return this.client.emit(constants.clientEvents.FORUM_TOPIC_UNPINNED, getCachedTopic ?? new ForumTopic(this.client, data.d.forumTopic)); + } + + forumTopicLocked(data: WSPacket<"ForumTopicLocked">): boolean { + const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); + getCachedTopic?._update({ + isLocked: true, + }); + return this.client.emit(constants.clientEvents.FORUM_TOPIC_LOCKED, getCachedTopic ?? new ForumTopic(this.client, data.d.forumTopic)); + } + + forumTopicUnlocked(data: WSPacket<"ForumTopicUnlocked">): boolean { + const getCachedTopic = this.client.topics.cache.get(data.d.forumTopic.id); + getCachedTopic?._update({ + isLocked: false, + }); + return this.client.emit(constants.clientEvents.FORUM_TOPIC_UNLOCKED, getCachedTopic ?? new ForumTopic(this.client, data.d.forumTopic)); + } } diff --git a/packages/guilded.js/lib/gateway/handler/GatewayEventHandler.ts b/packages/guilded.js/lib/gateway/handler/GatewayEventHandler.ts index 483598e6..ed8a2710 100644 --- a/packages/guilded.js/lib/gateway/handler/GatewayEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/GatewayEventHandler.ts @@ -1,5 +1,5 @@ import type { Client } from "../../structures/Client"; export abstract class GatewayEventHandler { - constructor(public readonly client: Client) {} + constructor(public readonly client: Client) {} } diff --git a/packages/guilded.js/lib/gateway/handler/ListEventHandler.ts b/packages/guilded.js/lib/gateway/handler/ListEventHandler.ts index cc646a86..557ae3fd 100644 --- a/packages/guilded.js/lib/gateway/handler/ListEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/ListEventHandler.ts @@ -4,34 +4,34 @@ import type { ListChannel } from "../../structures"; import { GatewayEventHandler } from "./GatewayEventHandler"; export class ListEventHandler extends GatewayEventHandler { - listItemCompleted(data: WSPacket<"ListItemCompleted">): boolean { - const existingChannel = this.client.channels.cache.get(data.d.listItem.channelId) as ListChannel | undefined; - if (existingChannel) existingChannel.items.set(data.d.listItem.id, data.d.listItem); - return this.client.emit(constants.clientEvents.LIST_ITEM_COMPLETED, data.d.listItem); - } + listItemCompleted(data: WSPacket<"ListItemCompleted">): boolean { + const existingChannel = this.client.channels.cache.get(data.d.listItem.channelId) as ListChannel | undefined; + if (existingChannel) existingChannel.items.set(data.d.listItem.id, data.d.listItem); + return this.client.emit(constants.clientEvents.LIST_ITEM_COMPLETED, data.d.listItem); + } - listItemUncompleted(data: WSPacket<"ListItemUncompleted">): boolean { - const existingChannel = this.client.channels.cache.get(data.d.listItem.channelId) as ListChannel | undefined; - if (existingChannel) existingChannel.items.set(data.d.listItem.id, data.d.listItem); - return this.client.emit(constants.clientEvents.LIST_ITEM_UNCOMPLETED, data.d.listItem); - } + listItemUncompleted(data: WSPacket<"ListItemUncompleted">): boolean { + const existingChannel = this.client.channels.cache.get(data.d.listItem.channelId) as ListChannel | undefined; + if (existingChannel) existingChannel.items.set(data.d.listItem.id, data.d.listItem); + return this.client.emit(constants.clientEvents.LIST_ITEM_UNCOMPLETED, data.d.listItem); + } - listItemCreated(data: WSPacket<"ListItemCreated">): boolean { - const existingChannel = this.client.channels.cache.get(data.d.listItem.channelId) as ListChannel | undefined; - if (existingChannel) existingChannel.items.set(data.d.listItem.id, data.d.listItem); - return this.client.emit(constants.clientEvents.LIST_ITEM_CREATED, data.d.listItem); - } + listItemCreated(data: WSPacket<"ListItemCreated">): boolean { + const existingChannel = this.client.channels.cache.get(data.d.listItem.channelId) as ListChannel | undefined; + if (existingChannel) existingChannel.items.set(data.d.listItem.id, data.d.listItem); + return this.client.emit(constants.clientEvents.LIST_ITEM_CREATED, data.d.listItem); + } - listItemUpdated(data: WSPacket<"ListItemUpdated">): boolean { - const existingChannel = this.client.channels.cache.get(data.d.listItem.channelId) as ListChannel | undefined; - const existingItem = existingChannel?.items.get(data.d.listItem.id); - if (existingChannel) existingChannel.items.set(data.d.listItem.id, data.d.listItem); - return this.client.emit(constants.clientEvents.LIST_ITEM_UPDATED, data.d.listItem, existingItem ?? null); - } + listItemUpdated(data: WSPacket<"ListItemUpdated">): boolean { + const existingChannel = this.client.channels.cache.get(data.d.listItem.channelId) as ListChannel | undefined; + const existingItem = existingChannel?.items.get(data.d.listItem.id); + if (existingChannel) existingChannel.items.set(data.d.listItem.id, data.d.listItem); + return this.client.emit(constants.clientEvents.LIST_ITEM_UPDATED, data.d.listItem, existingItem ?? null); + } - listItemDeleted(data: WSPacket<"ListItemDeleted">): boolean { - const existingChannel = this.client.channels.cache.get(data.d.listItem.channelId) as ListChannel | undefined; - if (existingChannel) existingChannel.items.set(data.d.listItem.id, data.d.listItem); - return this.client.emit(constants.clientEvents.LIST_ITEM_DELETED, data.d.listItem); - } + listItemDeleted(data: WSPacket<"ListItemDeleted">): boolean { + const existingChannel = this.client.channels.cache.get(data.d.listItem.channelId) as ListChannel | undefined; + if (existingChannel) existingChannel.items.set(data.d.listItem.id, data.d.listItem); + return this.client.emit(constants.clientEvents.LIST_ITEM_DELETED, data.d.listItem); + } } diff --git a/packages/guilded.js/lib/gateway/handler/MessageEventHandler.ts b/packages/guilded.js/lib/gateway/handler/MessageEventHandler.ts index 807b210a..414aa9c6 100644 --- a/packages/guilded.js/lib/gateway/handler/MessageEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/MessageEventHandler.ts @@ -4,39 +4,41 @@ import { Message } from "../../structures/Message"; import { GatewayEventHandler } from "./GatewayEventHandler"; export class MessageEventHandler extends GatewayEventHandler { - async messageCreated(data: WSPacket<"ChatMessageCreated">): Promise { - // This is in the case that a REST request beats us to adding the message in the cache. - const existingMessage = this.client.messages.cache.get(data.d.message.id); - if (existingMessage) return this.client.emit(constants.clientEvents.MESSAGE_CREATED, existingMessage); - - if ((this.client.options.cache?.fetchMessageAuthorOnCreate ?? true) && data.d.serverId && data.d.message.createdBy && data.d.message.createdBy !== "Ann6LewA") - await this.client.members.fetch(data.d.serverId, data.d.message.createdBy).catch(() => null); - - const newMessage = new Message(this.client, data.d.message); - if (this.client.messages.shouldCacheMessage) this.client.messages.cache.set(newMessage.id, newMessage); - - return this.client.emit(constants.clientEvents.MESSAGE_CREATED, newMessage); - } - - messageUpdated(data: WSPacket<"ChatMessageUpdated">): boolean { - const getCachedMessage = this.client.messages.cache.get(data.d.message.id); - if (!getCachedMessage) { - const newMessage = new Message(this.client, data.d.message); - return this.client.emit(constants.clientEvents.MESSAGE_UPDATED, newMessage, null); - } - - const frozenOldMessage = Object.freeze(getCachedMessage._clone()); - getCachedMessage._update(data.d.message); - - return this.client.emit(constants.clientEvents.MESSAGE_UPDATED, getCachedMessage, frozenOldMessage); - } - - messageDeleted(data: WSPacket<"ChatMessageDeleted">): boolean { - this.client.messages.cache.get(data.d.message.id)?._update({ deletedAt: data.d.message.deletedAt }); - - return this.client.emit(constants.clientEvents.MESSAGE_DELETED, { - ...data.d.message, - serverId: data.d.serverId, - }); - } + async messageCreated(data: WSPacket<"ChatMessageCreated">): Promise { + // This is in the case that a REST request beats us to adding the message in the cache. + const existingMessage = this.client.messages.cache.get(data.d.message.id); + if (existingMessage) return this.client.emit(constants.clientEvents.MESSAGE_CREATED, existingMessage); + + if ((this.client.options.cache?.fetchMessageAuthorOnCreate ?? true) && data.d.serverId && data.d.message.createdBy && data.d.message.createdBy !== "Ann6LewA") + await this.client.members.fetch(data.d.serverId, data.d.message.createdBy).catch(() => null); + + const newMessage = new Message(this.client, data.d.message); + if (this.client.messages.shouldCacheMessage) this.client.messages.cache.set(newMessage.id, newMessage); + + return this.client.emit(constants.clientEvents.MESSAGE_CREATED, newMessage); + } + + messageUpdated(data: WSPacket<"ChatMessageUpdated">): boolean { + const getCachedMessage = this.client.messages.cache.get(data.d.message.id); + if (!getCachedMessage) { + const newMessage = new Message(this.client, data.d.message); + return this.client.emit(constants.clientEvents.MESSAGE_UPDATED, newMessage, null); + } + + const frozenOldMessage = Object.freeze(getCachedMessage._clone()); + getCachedMessage._update(data.d.message); + + return this.client.emit(constants.clientEvents.MESSAGE_UPDATED, getCachedMessage, frozenOldMessage); + } + + messageDeleted(data: WSPacket<"ChatMessageDeleted">): boolean { + this.client.messages.cache.get(data.d.message.id)?._update({ + deletedAt: data.d.message.deletedAt, + }); + + return this.client.emit(constants.clientEvents.MESSAGE_DELETED, { + ...data.d.message, + serverId: data.d.serverId, + }); + } } diff --git a/packages/guilded.js/lib/gateway/handler/ReactionEventHandler.ts b/packages/guilded.js/lib/gateway/handler/ReactionEventHandler.ts index f738fe1a..9c6c5868 100644 --- a/packages/guilded.js/lib/gateway/handler/ReactionEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/ReactionEventHandler.ts @@ -5,28 +5,28 @@ import { buildMessageReactionKey } from "../../util"; import { GatewayEventHandler } from "./GatewayEventHandler"; export class ReactionEventHandler extends GatewayEventHandler { - messageReactionCreated(data: WSPacket<"ChannelMessageReactionCreated">): boolean { - const { - d: { reaction, serverId }, - } = data; + messageReactionCreated(data: WSPacket<"ChannelMessageReactionCreated">): boolean { + const { + d: { reaction, serverId }, + } = data; - const newReaction = new MessageReaction(this.client, { - ...reaction, - serverId, - }); - if (this.client.reactions.shouldCacheReaction) this.client.reactions.cache.set(buildMessageReactionKey(reaction.messageId, reaction.createdBy, reaction.emote.id), newReaction); - return this.client.emit(constants.clientEvents.MESSAGE_REACTION_CREATED, newReaction); - } + const newReaction = new MessageReaction(this.client, { + ...reaction, + serverId, + }); + if (this.client.reactions.shouldCacheReaction) this.client.reactions.cache.set(buildMessageReactionKey(reaction.messageId, reaction.createdBy, reaction.emote.id), newReaction); + return this.client.emit(constants.clientEvents.MESSAGE_REACTION_CREATED, newReaction); + } - messageReactionDeleted(data: WSPacket<"ChannelMessageReactionDeleted">): boolean { - const { - d: { reaction, serverId }, - } = data; + messageReactionDeleted(data: WSPacket<"ChannelMessageReactionDeleted">): boolean { + const { + d: { reaction, serverId }, + } = data; - if (this.client.reactions.shouldCacheReaction) this.client.reactions.cache.delete(buildMessageReactionKey(reaction.messageId, reaction.createdBy, reaction.emote.id)); - return this.client.emit(constants.clientEvents.MESSAGE_REACTION_DELETED, { - ...reaction, - serverId, - }); - } + if (this.client.reactions.shouldCacheReaction) this.client.reactions.cache.delete(buildMessageReactionKey(reaction.messageId, reaction.createdBy, reaction.emote.id)); + return this.client.emit(constants.clientEvents.MESSAGE_REACTION_DELETED, { + ...reaction, + serverId, + }); + } } diff --git a/packages/guilded.js/lib/gateway/handler/ServerChannelEventHandler.ts b/packages/guilded.js/lib/gateway/handler/ServerChannelEventHandler.ts index ef59eb18..ff26df6e 100644 --- a/packages/guilded.js/lib/gateway/handler/ServerChannelEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/ServerChannelEventHandler.ts @@ -4,26 +4,30 @@ import { transformTypeToChannel } from "../../managers/global/ChannelManager"; import { GatewayEventHandler } from "./GatewayEventHandler"; export class ServerChannelEventHandler extends GatewayEventHandler { - serverChannelCreated(data: WSPacket<"ServerChannelCreated">): boolean { - const existingChannel = this.client.channels.cache.get(data.d.channel.id); - if (existingChannel) return this.client.emit(constants.clientEvents.CHANNEL_CREATED, existingChannel); + serverChannelCreated(data: WSPacket<"ServerChannelCreated">): boolean { + const existingChannel = this.client.channels.cache.get(data.d.channel.id); + if (existingChannel) return this.client.emit(constants.clientEvents.CHANNEL_CREATED, existingChannel); - const newChannel = new (transformTypeToChannel(data.d.channel.type))(this.client, data.d.channel); - if (this.client.channels.shouldCacheChannel) this.client.channels.cache.set(newChannel.id, newChannel); - return this.client.emit(constants.clientEvents.CHANNEL_CREATED, newChannel); - } + const newChannel = new (transformTypeToChannel(data.d.channel.type))(this.client, data.d.channel); + if (this.client.channels.shouldCacheChannel) this.client.channels.cache.set(newChannel.id, newChannel); + return this.client.emit(constants.clientEvents.CHANNEL_CREATED, newChannel); + } - serverChannelUpdated(data: WSPacket<"ServerChannelUpdated">): boolean { - const existingChannel = this.client.channels.cache.get(data.d.channel.id); - const oldChannel = existingChannel?._clone(); - const updatedChannel = existingChannel?._update(data.d.channel) ?? new (transformTypeToChannel(data.d.channel.type))(this.client, data.d.channel); - return this.client.emit(constants.clientEvents.CHANNEL_UPDATED, updatedChannel, oldChannel ?? null); - } + serverChannelUpdated(data: WSPacket<"ServerChannelUpdated">): boolean { + const existingChannel = this.client.channels.cache.get(data.d.channel.id); + const oldChannel = existingChannel?._clone(); + const updatedChannel = existingChannel?._update(data.d.channel) ?? new (transformTypeToChannel(data.d.channel.type))(this.client, data.d.channel); + return this.client.emit(constants.clientEvents.CHANNEL_UPDATED, updatedChannel, oldChannel ?? null); + } - serverChannelDeleted(data: WSPacket<"ServerChannelDeleted">): boolean { - const existingChannel = this.client.channels.cache.get(data.d.channel.id); - const deletedChannel = existingChannel?._update({ ...data.d.channel, deleted: true }) ?? new (transformTypeToChannel(data.d.channel.type))(this.client, data.d.channel); - if (this.client.options.cache?.removeChannelOnDelete) this.client.channels.cache.delete(deletedChannel.id); - return this.client.emit(constants.clientEvents.CHANNEL_DELETED, deletedChannel); - } + serverChannelDeleted(data: WSPacket<"ServerChannelDeleted">): boolean { + const existingChannel = this.client.channels.cache.get(data.d.channel.id); + const deletedChannel = + existingChannel?._update({ + ...data.d.channel, + deleted: true, + }) ?? new (transformTypeToChannel(data.d.channel.type))(this.client, data.d.channel); + if (this.client.options.cache?.removeChannelOnDelete) this.client.channels.cache.delete(deletedChannel.id); + return this.client.emit(constants.clientEvents.CHANNEL_DELETED, deletedChannel); + } } diff --git a/packages/guilded.js/lib/gateway/handler/ServerEventHandler.ts b/packages/guilded.js/lib/gateway/handler/ServerEventHandler.ts index 8cc34a03..44bf190c 100644 --- a/packages/guilded.js/lib/gateway/handler/ServerEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/ServerEventHandler.ts @@ -4,17 +4,26 @@ import { buildMemberKey } from "../../util"; import { GatewayEventHandler } from "./GatewayEventHandler"; export class ServerEventHandler extends GatewayEventHandler { - serverRolesUpdated(data: WSPacket<"ServerRolesUpdated">): boolean { - const oldMembers = []; - // update members cache - for (const m of data.d.memberRoleIds) { - const member = this.client.members.cache.get(buildMemberKey(data.d.serverId, m.userId)); - if (member) { - oldMembers.push(member._clone()); - member._update({ roleIds: m.roleIds }); - } - } + serverRolesUpdated(data: WSPacket<"ServerRolesUpdated">): boolean { + const oldMembers = []; + // update members cache + for (const m of data.d.memberRoleIds) { + const member = this.client.members.cache.get(buildMemberKey(data.d.serverId, m.userId)); + if (member) { + oldMembers.push(member._clone()); + member._update({ + roleIds: m.roleIds, + }); + } + } - return this.client.emit(constants.clientEvents.ROLES_UPATED, { serverId: data.d.serverId, members: data.d.memberRoleIds }, oldMembers); - } + return this.client.emit( + constants.clientEvents.ROLES_UPATED, + { + serverId: data.d.serverId, + members: data.d.memberRoleIds, + }, + oldMembers, + ); + } } diff --git a/packages/guilded.js/lib/gateway/handler/ServerMemberEventHandler.ts b/packages/guilded.js/lib/gateway/handler/ServerMemberEventHandler.ts index d16f8815..fea43cd1 100644 --- a/packages/guilded.js/lib/gateway/handler/ServerMemberEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/ServerMemberEventHandler.ts @@ -5,118 +5,123 @@ import { buildMemberKey } from "../../util"; import { GatewayEventHandler } from "./GatewayEventHandler"; export class ServerMemberEventHandler extends GatewayEventHandler { - serverMemberUpdated(data: WSPacket<"ServerMemberUpdated">): boolean { - const { - d: { - userInfo: { id, nickname }, - serverId, - }, - } = data; - - const member = this.client.members.cache.get(buildMemberKey(serverId, id)); - - const oldMember = member?._clone(); - member?._update({ nickname: data.d.userInfo.nickname ?? undefined }); - - return this.client.emit(constants.clientEvents.MEMBER_UPDATED, { - serverId, - userId: id, - nickname: nickname ?? null, - oldMember: oldMember ?? null, - }); - } - - serverMemberJoined(data: WSPacket<"ServerMemberJoined">): boolean { - const newMember = new Member(this.client, { - ...data.d.member, - serverId: data.d.serverId, - id: data.d.member.user.id, - }); - const newUser = new User(this.client, data.d.member.user); - - this.client.members.cache.set(buildMemberKey(data.d.serverId, data.d.member.user.id), newMember); - this.client.users.cache.set(newUser.id, newUser); - if (data.d.member.user.id === this.client.user!.id) - this.client.emit(constants.clientEvents.SERVER_CREATED, { - serverId: data.d.serverId, - }); - return this.client.emit(constants.clientEvents.MEMBER_JOINED, newMember); - } - - serverMemberRemoved(data: WSPacket<"ServerMemberRemoved">): boolean { - const memberKey = buildMemberKey(data.d.serverId, data.d.userId); - const existingMember = this.client.members.cache.get(memberKey); - if (this.client.options.cache?.removeMemberOnLeave) this.client.members.cache.delete(memberKey); - - existingMember?._update({ - kicked: data.d.isKick, - banned: data.d.isBan, - }); - return this.client.emit(constants.clientEvents.MEMBER_REMOVED, data.d); - } - - serverMemberBanned(data: WSPacket<"ServerMemberBanned">): boolean { - const newMemberBan = new MemberBan(this.client, { - serverId: data.d.serverId, - ...data.d.serverMemberBan, - }); - if (this.client.options.cache?.cacheMemberBans !== false) this.client.bans.cache.set(buildMemberKey(newMemberBan.serverId, newMemberBan.target.id), newMemberBan); - return this.client.emit(constants.clientEvents.MEMBER_BANNED, newMemberBan); - } - - serverMemberUnbanned(data: WSPacket<"ServerMemberUnbanned">): boolean { - const { - d: { - serverId, - serverMemberBan: { createdAt, createdBy, reason, user }, - }, - } = data; - - const memberKey = buildMemberKey(serverId, user.id); - const existingMemberBan = this.client.bans.cache.get(memberKey); - if (existingMemberBan && this.client.options.cache?.removeMemberBanOnUnban) this.client.bans.cache.delete(existingMemberBan.id); - const existingMember = this.client.members.cache.get(memberKey); - if (existingMember) existingMember._update({ banned: false }); - - return this.client.emit(constants.clientEvents.MEMBER_UNBANNED, { - createdAt, - createdBy, - reason, - user, - serverId, - }); - } - - serverMemberSocialLinkCreated(data: WSPacket<"ServerMemberSocialLinkCreated">): boolean { - const { - d: { serverId, socialLink }, - } = data; - - const existingMember = this.client.members.cache.get(buildMemberKey(serverId, socialLink.userId)); - if (this.client.members.shouldCacheSocialLinks) existingMember?.socialLinks.set(socialLink.type, socialLink); - - return this.client.emit(constants.clientEvents.MEMBER_SOCIAL_LINK_CREATED, serverId, socialLink); - } - - serverMemberSocialLinkUpdated(data: WSPacket<"ServerMemberSocialLinkUpdated">): boolean { - const { - d: { serverId, socialLink }, - } = data; - - const existingMember = this.client.members.cache.get(buildMemberKey(serverId, socialLink.userId)); - if (this.client.members.shouldCacheSocialLinks) existingMember?.socialLinks.set(socialLink.type, socialLink); - - return this.client.emit(constants.clientEvents.MEMBER_SOCIAL_LINK_UPDATED, serverId, socialLink); - } - - serverMemberSocialLinkDeleted(data: WSPacket<"ServerMemberSocialLinkDeleted">): boolean { - const { - d: { serverId, socialLink }, - } = data; - - const existingMember = this.client.members.cache.get(buildMemberKey(serverId, socialLink.userId)); - if (this.client.members.shouldCacheSocialLinks) existingMember?.socialLinks.delete(socialLink.type); - - return this.client.emit(constants.clientEvents.MEMBER_SOCIAL_LINK_DELETED, serverId, socialLink); - } + serverMemberUpdated(data: WSPacket<"ServerMemberUpdated">): boolean { + const { + d: { + userInfo: { id, nickname }, + serverId, + }, + } = data; + + const member = this.client.members.cache.get(buildMemberKey(serverId, id)); + + const oldMember = member?._clone(); + member?._update({ + nickname: data.d.userInfo.nickname ?? undefined, + }); + + return this.client.emit(constants.clientEvents.MEMBER_UPDATED, { + serverId, + userId: id, + nickname: nickname ?? null, + oldMember: oldMember ?? null, + }); + } + + serverMemberJoined(data: WSPacket<"ServerMemberJoined">): boolean { + const newMember = new Member(this.client, { + ...data.d.member, + serverId: data.d.serverId, + id: data.d.member.user.id, + }); + const newUser = new User(this.client, data.d.member.user); + + this.client.members.cache.set(buildMemberKey(data.d.serverId, data.d.member.user.id), newMember); + this.client.users.cache.set(newUser.id, newUser); + if (data.d.member.user.id === this.client.user?.id) + this.client.emit(constants.clientEvents.SERVER_CREATED, { + serverId: data.d.serverId, + }); + return this.client.emit(constants.clientEvents.MEMBER_JOINED, newMember); + } + + serverMemberRemoved(data: WSPacket<"ServerMemberRemoved">): boolean { + const memberKey = buildMemberKey(data.d.serverId, data.d.userId); + const existingMember = this.client.members.cache.get(memberKey); + if (this.client.options.cache?.removeMemberOnLeave) this.client.members.cache.delete(memberKey); + + existingMember?._update({ + kicked: data.d.isKick, + banned: data.d.isBan, + }); + return this.client.emit(constants.clientEvents.MEMBER_REMOVED, data.d); + } + + serverMemberBanned(data: WSPacket<"ServerMemberBanned">): boolean { + const newMemberBan = new MemberBan(this.client, { + serverId: data.d.serverId, + ...data.d.serverMemberBan, + }); + if (this.client.options.cache?.cacheMemberBans !== false) this.client.bans.cache.set(buildMemberKey(newMemberBan.serverId, newMemberBan.target.id), newMemberBan); + return this.client.emit(constants.clientEvents.MEMBER_BANNED, newMemberBan); + } + + serverMemberUnbanned(data: WSPacket<"ServerMemberUnbanned">): boolean { + const { + d: { + serverId, + serverMemberBan: { createdAt, createdBy, reason, user }, + }, + } = data; + + const memberKey = buildMemberKey(serverId, user.id); + const existingMemberBan = this.client.bans.cache.get(memberKey); + if (existingMemberBan && this.client.options.cache?.removeMemberBanOnUnban) this.client.bans.cache.delete(existingMemberBan.id); + const existingMember = this.client.members.cache.get(memberKey); + if (existingMember) + existingMember._update({ + banned: false, + }); + + return this.client.emit(constants.clientEvents.MEMBER_UNBANNED, { + createdAt, + createdBy, + reason, + user, + serverId, + }); + } + + serverMemberSocialLinkCreated(data: WSPacket<"ServerMemberSocialLinkCreated">): boolean { + const { + d: { serverId, socialLink }, + } = data; + + const existingMember = this.client.members.cache.get(buildMemberKey(serverId, socialLink.userId)); + if (this.client.members.shouldCacheSocialLinks) existingMember?.socialLinks.set(socialLink.type, socialLink); + + return this.client.emit(constants.clientEvents.MEMBER_SOCIAL_LINK_CREATED, serverId, socialLink); + } + + serverMemberSocialLinkUpdated(data: WSPacket<"ServerMemberSocialLinkUpdated">): boolean { + const { + d: { serverId, socialLink }, + } = data; + + const existingMember = this.client.members.cache.get(buildMemberKey(serverId, socialLink.userId)); + if (this.client.members.shouldCacheSocialLinks) existingMember?.socialLinks.set(socialLink.type, socialLink); + + return this.client.emit(constants.clientEvents.MEMBER_SOCIAL_LINK_UPDATED, serverId, socialLink); + } + + serverMemberSocialLinkDeleted(data: WSPacket<"ServerMemberSocialLinkDeleted">): boolean { + const { + d: { serverId, socialLink }, + } = data; + + const existingMember = this.client.members.cache.get(buildMemberKey(serverId, socialLink.userId)); + if (this.client.members.shouldCacheSocialLinks) existingMember?.socialLinks.delete(socialLink.type); + + return this.client.emit(constants.clientEvents.MEMBER_SOCIAL_LINK_DELETED, serverId, socialLink); + } } diff --git a/packages/guilded.js/lib/gateway/handler/ServerWebhookEventHandler.ts b/packages/guilded.js/lib/gateway/handler/ServerWebhookEventHandler.ts index d49fa8cc..77b15ed7 100644 --- a/packages/guilded.js/lib/gateway/handler/ServerWebhookEventHandler.ts +++ b/packages/guilded.js/lib/gateway/handler/ServerWebhookEventHandler.ts @@ -4,24 +4,24 @@ import { Webhook } from "../../structures/Webhook"; import { GatewayEventHandler } from "./GatewayEventHandler"; export class ServerWebhookEventHandler extends GatewayEventHandler { - serverWebhookCreated(data: WSPacket<"ServerWebhookCreated">): boolean { - const existingWebhook = this.client.webhooks.cache.get(data.d.webhook.id); - if (existingWebhook) return this.client.emit(constants.clientEvents.WEBHOOK_CREATED, existingWebhook); + serverWebhookCreated(data: WSPacket<"ServerWebhookCreated">): boolean { + const existingWebhook = this.client.webhooks.cache.get(data.d.webhook.id); + if (existingWebhook) return this.client.emit(constants.clientEvents.WEBHOOK_CREATED, existingWebhook); - const newWebhook = new Webhook(this.client, data.d.webhook); - this.client.webhooks.cache.set(newWebhook.id, newWebhook); - return this.client.emit(constants.clientEvents.WEBHOOK_CREATED, newWebhook); - } + const newWebhook = new Webhook(this.client, data.d.webhook); + this.client.webhooks.cache.set(newWebhook.id, newWebhook); + return this.client.emit(constants.clientEvents.WEBHOOK_CREATED, newWebhook); + } - serverWebhookUpdated(data: WSPacket<"ServerWebhookUpdated">): boolean { - const getCachedWebhook = this.client.webhooks.cache.get(data.d.webhook.id); - if (!getCachedWebhook) { - const newWebhook = new Webhook(this.client, data.d.webhook); - return this.client.emit(constants.clientEvents.WEBHOOK_UPDATED, newWebhook, null); - } + serverWebhookUpdated(data: WSPacket<"ServerWebhookUpdated">): boolean { + const getCachedWebhook = this.client.webhooks.cache.get(data.d.webhook.id); + if (!getCachedWebhook) { + const newWebhook = new Webhook(this.client, data.d.webhook); + return this.client.emit(constants.clientEvents.WEBHOOK_UPDATED, newWebhook, null); + } - const frozenOldWebhook = Object.freeze(getCachedWebhook._clone()); - getCachedWebhook._update(data.d.webhook); - return this.client.emit(constants.clientEvents.WEBHOOK_UPDATED, getCachedWebhook, frozenOldWebhook); - } + const frozenOldWebhook = Object.freeze(getCachedWebhook._clone()); + getCachedWebhook._update(data.d.webhook); + return this.client.emit(constants.clientEvents.WEBHOOK_UPDATED, getCachedWebhook, frozenOldWebhook); + } } diff --git a/packages/guilded.js/lib/managers/global/CacheableStructManager.ts b/packages/guilded.js/lib/managers/global/CacheableStructManager.ts index e5b0de28..070e7b3e 100644 --- a/packages/guilded.js/lib/managers/global/CacheableStructManager.ts +++ b/packages/guilded.js/lib/managers/global/CacheableStructManager.ts @@ -11,5 +11,5 @@ import { GlobalManager } from "./GlobalManager"; * @extends GlobalManager */ export class CacheableStructManager extends GlobalManager { - cache = new Collection(); + cache = new Collection(); } diff --git a/packages/guilded.js/lib/managers/global/CalendarManager.ts b/packages/guilded.js/lib/managers/global/CalendarManager.ts index 3be5f1e9..f81b1b41 100644 --- a/packages/guilded.js/lib/managers/global/CalendarManager.ts +++ b/packages/guilded.js/lib/managers/global/CalendarManager.ts @@ -8,215 +8,218 @@ import { CacheableStructManager } from "./CacheableStructManager"; * The manager is used to interact with calendars on a server. */ export class GlobalCalendarManager extends CacheableStructManager { - get shouldCacheCalendar(): boolean { - return this.client.options?.cache?.cacheCalendars !== false; - } - - get shouldCacheCalendarRsvps(): boolean { - return this.client.options?.cache?.cacheCalendarsRsvps !== false; - } - - /** - * Creates a calendar event. - * - * @param channelId The ID of the channel in which to create the event. - * @param options The options for the event. - * @returns A promise that resolves with the created calendar event. - */ - async create(channelId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.calendarEvents.calendarEventCreate({ - channelId, - requestBody: options, - }); - return new CalendarEvent(this.client, data.calendarEvent); - } - - /** - * Fetches a single calendar event. - * - * @param channelId The ID of the channel in which to fetch the event. - * @param calendarEventId The ID of the event to fetch. - * @param force Whether or not to force a fetch instead of using a cached version. - * @returns A promise that resolves with the fetched calendar event. - */ - async fetch(channelId: string, calendarEventId: number, force?: boolean): Promise { - if (!force) { - const existingCalendar = this.client.calendars.cache.get(calendarEventId); - if (existingCalendar) return existingCalendar; - } - - const data = await this.client.rest.router.calendarEvents.calendarEventRead({ channelId, calendarEventId }); - const newCalendar = new CalendarEvent(this.client, data.calendarEvent); - if (this.shouldCacheCalendar) this.client.calendars.cache.set(newCalendar.id, newCalendar); - return newCalendar; - } - - /** - * Fetches multiple calendar events. - * - * @param channelId The ID of the channel in which to fetch the events. - * @param options The options for the fetch. - * @returns A promise that resolves with a collection of the fetched calendar events. - */ - async fetchMany(channelId: string, options: Omit, "channelId">): Promise> { - const data = await this.client.rest.router.calendarEvents.calendarEventReadMany({ - channelId, - ...options, - }); - const calendarEvents = new Collection(); - for (const calendarEvent of data.calendarEvents) { - const newCalendar = new CalendarEvent(this.client, calendarEvent); - calendarEvents.set(newCalendar.id, newCalendar); - if (this.shouldCacheCalendar) this.client.calendars.cache.set(newCalendar.id, newCalendar); - } - - return calendarEvents; - } - - /** - * Updates a calendar event. - * - * @param channelId The ID of the channel in which the event exists. - * @param calendarEventId The ID of the event to update. - * @param options The options for the update. - * @returns A promise that resolves with the updated calendar event. - */ - async update(channelId: string, calendarEventId: number, options: OptionBody): Promise { - const data = await this.client.rest.router.calendarEvents.calendarEventUpdate({ - channelId, - calendarEventId, - requestBody: options, - }); - const existingCalendar = this.cache.get(calendarEventId); - if (existingCalendar) return existingCalendar._update(data.calendarEvent); - const newCalendar = new CalendarEvent(this.client, data.calendarEvent); - if (this.shouldCacheCalendar) this.cache.set(newCalendar.id, newCalendar); - return newCalendar; - } - - /** - * Delete a calendar event. - * - * @param channelId - The ID of the channel where the calendar event is located. - * @param calendarEventId - The ID of the calendar event to delete. - * @returns A Promise that resolves with the deleted calendar event or `undefined` if the event was not cached. - */ - async delete(channelId: string, calendarEventId: number): Promise { - await this.client.rest.router.calendarEvents.calendarEventDelete({ - channelId, - calendarEventId, - }); - const cachedCalendar = this.cache.get(calendarEventId); - return cachedCalendar ?? null; - } - - /** - * Get a single RSVP from a calendar event. - * - * @param channelId - The ID of the channel where the calendar event is located. - * @param calendarEventId - The ID of the calendar event to get the RSVP from. - * @param userId - The ID of the user who made the RSVP. - * @param force - Whether to force a request to the API instead of returning the cached RSVP. - * @returns A Promise that resolves with the requested RSVP. - */ - async fetchRsvp(channelId: string, calendarEventId: number, userId: string, force?: boolean): Promise { - if (!force) { - const existingRsvp = this.client.calendars.cache.get(calendarEventId)?.rsvps?.get(userId); - if (existingRsvp) return existingRsvp; - } - - const data = await this.client.rest.router.calendarEvents.calendarEventRsvpRead({ - channelId, - calendarEventId, - userId, - }); - const newRsvp = new CalendarEventRsvp(this.client, data.calendarEventRsvp); - if (this.shouldCacheCalendar && this.shouldCacheCalendarRsvps) this.cache.get(newRsvp.calendarEventId)?.rsvps?.set(newRsvp.userId, newRsvp); - return newRsvp; - } - - /** - * Fetch RSVPs for a calendar event. - * - * @param channelId - The ID of the channel where the calendar event is located. - * @param calendarEventId - The ID of the calendar event to fetch RSVPs for. - * @returns A Promise that resolves with a collection of RSVPs. - */ - async fetchManyRsvps(channelId: string, calendarEventId: number): Promise> { - const data = await this.client.rest.router.calendarEvents.calendarEventRsvpReadMany({ - channelId, - calendarEventId, - }); - const rsvpEvents = new Collection(); - for (const rsvpEvent of data.calendarEventRsvps) { - if (this.shouldCacheCalendar && this.shouldCacheCalendarRsvps) { - const cachedCalendar = this.cache.get(calendarEventId); - cachedCalendar?.rsvps?.set(rsvpEvent.userId, new CalendarEventRsvp(this.client, rsvpEvent)); - } - - rsvpEvents.set(rsvpEvent.userId, new CalendarEventRsvp(this.client, rsvpEvent)); - } - - return rsvpEvents; - } - - /** - * Creates or updates an RSVP for a calendar event. - * - * @param channelId The ID of the channel. - * @param calendarEventId The ID of the calendar event. - * @param userId The ID of the user. - * @param options The options for updating the RSVP. - * @returns A promise that resolves with the updated or created RSVP. - */ - async updateRsvp(channelId: string, calendarEventId: number, userId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.calendarEvents.calendarEventRsvpUpdate({ - channelId, - calendarEventId, - userId, - requestBody: options, - }); - - const existingRsvp = this.cache.get(calendarEventId)?.rsvps?.get(userId); - if (existingRsvp) return existingRsvp._update(data.calendarEventRsvp); - - const newRsvp = new CalendarEventRsvp(this.client, data.calendarEventRsvp); - if (this.shouldCacheCalendar && this.shouldCacheCalendarRsvps) this.cache.get(calendarEventId)?.rsvps?.set(userId, newRsvp); - return newRsvp; - } - - /** - * Creates or updates multiple RSVPs for a calendar event. - * - * @param channelId The ID of the channel. - * @param calendarEventId The ID of the calendar event. - * @param options The options for updating many RSVP. - */ - async updateManyRsvp(channelId: string, calendarEventId: number, options: OptionBody): Promise { - await this.client.rest.router.calendarEvents.calendarEventRsvpUpdateMany({ - channelId, - calendarEventId, - requestBody: options, - }); - } - - /** - * Deletes an RSVP for a calendar event. - * - * @param channelId The ID of the channel. - * @param calendarEventId The ID of the calendar event. - * @param userId The ID of the user. - * @returns A promise that resolves with the deleted RSVP or void if it was not cached. - */ - async deleteRsvp(channelId: string, calendarEventId: number, userId: string): Promise { - await this.client.rest.router.calendarEvents.calendarEventRsvpDelete({ - channelId, - calendarEventId, - userId, - }); - if (this.shouldCacheCalendar && this.shouldCacheCalendarRsvps) { - const cachedCalendar = this.cache.get(calendarEventId); - cachedCalendar?.rsvps?.delete(userId); - } - } + get shouldCacheCalendar(): boolean { + return this.client.options?.cache?.cacheCalendars !== false; + } + + get shouldCacheCalendarRsvps(): boolean { + return this.client.options?.cache?.cacheCalendarsRsvps !== false; + } + + /** + * Creates a calendar event. + * + * @param channelId The ID of the channel in which to create the event. + * @param options The options for the event. + * @returns A promise that resolves with the created calendar event. + */ + async create(channelId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.calendarEvents.calendarEventCreate({ + channelId, + requestBody: options, + }); + return new CalendarEvent(this.client, data.calendarEvent); + } + + /** + * Fetches a single calendar event. + * + * @param channelId The ID of the channel in which to fetch the event. + * @param calendarEventId The ID of the event to fetch. + * @param force Whether or not to force a fetch instead of using a cached version. + * @returns A promise that resolves with the fetched calendar event. + */ + async fetch(channelId: string, calendarEventId: number, force?: boolean): Promise { + if (!force) { + const existingCalendar = this.client.calendars.cache.get(calendarEventId); + if (existingCalendar) return existingCalendar; + } + + const data = await this.client.rest.router.calendarEvents.calendarEventRead({ + channelId, + calendarEventId, + }); + const newCalendar = new CalendarEvent(this.client, data.calendarEvent); + if (this.shouldCacheCalendar) this.client.calendars.cache.set(newCalendar.id, newCalendar); + return newCalendar; + } + + /** + * Fetches multiple calendar events. + * + * @param channelId The ID of the channel in which to fetch the events. + * @param options The options for the fetch. + * @returns A promise that resolves with a collection of the fetched calendar events. + */ + async fetchMany(channelId: string, options: Omit, "channelId">): Promise> { + const data = await this.client.rest.router.calendarEvents.calendarEventReadMany({ + channelId, + ...options, + }); + const calendarEvents = new Collection(); + for (const calendarEvent of data.calendarEvents) { + const newCalendar = new CalendarEvent(this.client, calendarEvent); + calendarEvents.set(newCalendar.id, newCalendar); + if (this.shouldCacheCalendar) this.client.calendars.cache.set(newCalendar.id, newCalendar); + } + + return calendarEvents; + } + + /** + * Updates a calendar event. + * + * @param channelId The ID of the channel in which the event exists. + * @param calendarEventId The ID of the event to update. + * @param options The options for the update. + * @returns A promise that resolves with the updated calendar event. + */ + async update(channelId: string, calendarEventId: number, options: OptionBody): Promise { + const data = await this.client.rest.router.calendarEvents.calendarEventUpdate({ + channelId, + calendarEventId, + requestBody: options, + }); + const existingCalendar = this.cache.get(calendarEventId); + if (existingCalendar) return existingCalendar._update(data.calendarEvent); + const newCalendar = new CalendarEvent(this.client, data.calendarEvent); + if (this.shouldCacheCalendar) this.cache.set(newCalendar.id, newCalendar); + return newCalendar; + } + + /** + * Delete a calendar event. + * + * @param channelId - The ID of the channel where the calendar event is located. + * @param calendarEventId - The ID of the calendar event to delete. + * @returns A Promise that resolves with the deleted calendar event or `undefined` if the event was not cached. + */ + async delete(channelId: string, calendarEventId: number): Promise { + await this.client.rest.router.calendarEvents.calendarEventDelete({ + channelId, + calendarEventId, + }); + const cachedCalendar = this.cache.get(calendarEventId); + return cachedCalendar ?? null; + } + + /** + * Get a single RSVP from a calendar event. + * + * @param channelId - The ID of the channel where the calendar event is located. + * @param calendarEventId - The ID of the calendar event to get the RSVP from. + * @param userId - The ID of the user who made the RSVP. + * @param force - Whether to force a request to the API instead of returning the cached RSVP. + * @returns A Promise that resolves with the requested RSVP. + */ + async fetchRsvp(channelId: string, calendarEventId: number, userId: string, force?: boolean): Promise { + if (!force) { + const existingRsvp = this.client.calendars.cache.get(calendarEventId)?.rsvps?.get(userId); + if (existingRsvp) return existingRsvp; + } + + const data = await this.client.rest.router.calendarEvents.calendarEventRsvpRead({ + channelId, + calendarEventId, + userId, + }); + const newRsvp = new CalendarEventRsvp(this.client, data.calendarEventRsvp); + if (this.shouldCacheCalendar && this.shouldCacheCalendarRsvps) this.cache.get(newRsvp.calendarEventId)?.rsvps?.set(newRsvp.userId, newRsvp); + return newRsvp; + } + + /** + * Fetch RSVPs for a calendar event. + * + * @param channelId - The ID of the channel where the calendar event is located. + * @param calendarEventId - The ID of the calendar event to fetch RSVPs for. + * @returns A Promise that resolves with a collection of RSVPs. + */ + async fetchManyRsvps(channelId: string, calendarEventId: number): Promise> { + const data = await this.client.rest.router.calendarEvents.calendarEventRsvpReadMany({ + channelId, + calendarEventId, + }); + const rsvpEvents = new Collection(); + for (const rsvpEvent of data.calendarEventRsvps) { + if (this.shouldCacheCalendar && this.shouldCacheCalendarRsvps) { + const cachedCalendar = this.cache.get(calendarEventId); + cachedCalendar?.rsvps?.set(rsvpEvent.userId, new CalendarEventRsvp(this.client, rsvpEvent)); + } + + rsvpEvents.set(rsvpEvent.userId, new CalendarEventRsvp(this.client, rsvpEvent)); + } + + return rsvpEvents; + } + + /** + * Creates or updates an RSVP for a calendar event. + * + * @param channelId The ID of the channel. + * @param calendarEventId The ID of the calendar event. + * @param userId The ID of the user. + * @param options The options for updating the RSVP. + * @returns A promise that resolves with the updated or created RSVP. + */ + async updateRsvp(channelId: string, calendarEventId: number, userId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.calendarEvents.calendarEventRsvpUpdate({ + channelId, + calendarEventId, + userId, + requestBody: options, + }); + + const existingRsvp = this.cache.get(calendarEventId)?.rsvps?.get(userId); + if (existingRsvp) return existingRsvp._update(data.calendarEventRsvp); + + const newRsvp = new CalendarEventRsvp(this.client, data.calendarEventRsvp); + if (this.shouldCacheCalendar && this.shouldCacheCalendarRsvps) this.cache.get(calendarEventId)?.rsvps?.set(userId, newRsvp); + return newRsvp; + } + + /** + * Creates or updates multiple RSVPs for a calendar event. + * + * @param channelId The ID of the channel. + * @param calendarEventId The ID of the calendar event. + * @param options The options for updating many RSVP. + */ + async updateManyRsvp(channelId: string, calendarEventId: number, options: OptionBody): Promise { + await this.client.rest.router.calendarEvents.calendarEventRsvpUpdateMany({ + channelId, + calendarEventId, + requestBody: options, + }); + } + + /** + * Deletes an RSVP for a calendar event. + * + * @param channelId The ID of the channel. + * @param calendarEventId The ID of the calendar event. + * @param userId The ID of the user. + * @returns A promise that resolves with the deleted RSVP or void if it was not cached. + */ + async deleteRsvp(channelId: string, calendarEventId: number, userId: string): Promise { + await this.client.rest.router.calendarEvents.calendarEventRsvpDelete({ + channelId, + calendarEventId, + userId, + }); + if (this.shouldCacheCalendar && this.shouldCacheCalendarRsvps) { + const cachedCalendar = this.cache.get(calendarEventId); + cachedCalendar?.rsvps?.delete(userId); + } + } } diff --git a/packages/guilded.js/lib/managers/global/CategoryManager.ts b/packages/guilded.js/lib/managers/global/CategoryManager.ts index 6d06b5fd..d9871fd8 100644 --- a/packages/guilded.js/lib/managers/global/CategoryManager.ts +++ b/packages/guilded.js/lib/managers/global/CategoryManager.ts @@ -7,62 +7,65 @@ import { CacheableStructManager } from "./CacheableStructManager"; * Manager for interacting with Catregories on Guilded. */ export class GlobalCategoryManager extends CacheableStructManager { - /** - * Create a new category - * - * @param serverId The ID of the server to create the category in. - * @param options Category creation options - * @returns Promise that resolves with the newly created category - */ - async create(serverId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.categories.categoryCreate({ - serverId, - requestBody: options, - }); - const createdCategory = new Category(this.client, data.category); - this.cache.set(createdCategory.id, createdCategory); - return createdCategory; - } + /** + * Create a new category + * + * @param serverId The ID of the server to create the category in. + * @param options Category creation options + * @returns Promise that resolves with the newly created category + */ + async create(serverId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.categories.categoryCreate({ + serverId, + requestBody: options, + }); + const createdCategory = new Category(this.client, data.category); + this.cache.set(createdCategory.id, createdCategory); + return createdCategory; + } - async fetch(serverId: string, categoryId: number): Promise { - const data = await this.client.rest.router.categories.categoryRead({ - serverId, - categoryId, - }); - const fetchedCategory = new Category(this.client, data.category); - this.cache.set(fetchedCategory.id, fetchedCategory); - return fetchedCategory; - } + async fetch(serverId: string, categoryId: number): Promise { + const data = await this.client.rest.router.categories.categoryRead({ + serverId, + categoryId, + }); + const fetchedCategory = new Category(this.client, data.category); + this.cache.set(fetchedCategory.id, fetchedCategory); + return fetchedCategory; + } - /** - * Update a category - * - * @param serverId The ID of the server to update the category in. - * @param categoryId The ID of the category to update. - * @param options The options to update the category with. - * @returns A Promise that resolves with the updated category. - */ - async update(serverId: string, categoryId: number, options: OptionBody): Promise { - const data = await this.client.rest.router.categories.categoryUpdate({ - serverId, - categoryId, - requestBody: options, - }); + /** + * Update a category + * + * @param serverId The ID of the server to update the category in. + * @param categoryId The ID of the category to update. + * @param options The options to update the category with. + * @returns A Promise that resolves with the updated category. + */ + async update(serverId: string, categoryId: number, options: OptionBody): Promise { + const data = await this.client.rest.router.categories.categoryUpdate({ + serverId, + categoryId, + requestBody: options, + }); - let category = this.cache.get(data.category.id)?._update(data.category); - category ??= new Category(this.client, data.category); - return category; - } + let category = this.cache.get(data.category.id)?._update(data.category); + category ??= new Category(this.client, data.category); + return category; + } - /** - * Delete a category - * - * @param serverId The ID of the server to delete the category from. - * @param categoryId The ID of the category to delete. - * @returns A Promise that resolves when the operation is complete. - */ - async delete(serverId: string, categoryId: number): Promise { - await this.client.rest.router.categories.categoryDelete({ serverId, categoryId }); - if (this.cache.has(categoryId)) this.cache.delete(categoryId); - } + /** + * Delete a category + * + * @param serverId The ID of the server to delete the category from. + * @param categoryId The ID of the category to delete. + * @returns A Promise that resolves when the operation is complete. + */ + async delete(serverId: string, categoryId: number): Promise { + await this.client.rest.router.categories.categoryDelete({ + serverId, + categoryId, + }); + if (this.cache.has(categoryId)) this.cache.delete(categoryId); + } } diff --git a/packages/guilded.js/lib/managers/global/ChannelManager.ts b/packages/guilded.js/lib/managers/global/ChannelManager.ts index c57aed13..8fdc8fbc 100644 --- a/packages/guilded.js/lib/managers/global/ChannelManager.ts +++ b/packages/guilded.js/lib/managers/global/ChannelManager.ts @@ -11,106 +11,112 @@ import { CacheableStructManager } from "./CacheableStructManager"; * @extends CacheableStructManager */ export class GlobalChannelManager extends CacheableStructManager { - /** Determine whether a channel should be cached or not */ - get shouldCacheChannel(): boolean { - return this.client.options?.cache?.cacheChannels !== false; - } + /** Determine whether a channel should be cached or not */ + get shouldCacheChannel(): boolean { + return this.client.options?.cache?.cacheChannels !== false; + } - /** - * Create a new channel - * - * @param options Channel creation options - * @returns Promise that resolves with the newly created channel - */ - async create(options: OptionBody): Promise { - const data = await this.client.rest.router.channels.channelCreate({ - requestBody: options, - }); - if (data.channel.messageId && data.channel.rootId && data.channel.parentId) { - return new ThreadChannel(this.client, data.channel); - } + /** + * Create a new channel + * + * @param options Channel creation options + * @returns Promise that resolves with the newly created channel + */ + async create(options: OptionBody): Promise { + const data = await this.client.rest.router.channels.channelCreate({ + requestBody: options, + }); + if (data.channel.messageId && data.channel.rootId && data.channel.parentId) { + return new ThreadChannel(this.client, data.channel); + } - return new (transformTypeToChannel(data.channel.type))(this.client, data.channel); - } + return new (transformTypeToChannel(data.channel.type))(this.client, data.channel); + } - /** - * Fetch a channel by ID - * Notice: if you're using TypeScript, you will need to upcast to your desired channel type. - * - * @param channelId ID of the channel to fetch - * @param force Whether to force a fetch from the API - * @returns Promise that resolves with the fetched channel - */ - async fetch(channelId: string, force?: boolean): Promise { - if (!force) { - const existingChannel = this.client.channels.cache.get(channelId); - if (existingChannel) return existingChannel; - } + /** + * Fetch a channel by ID + * Notice: if you're using TypeScript, you will need to upcast to your desired channel type. + * + * @param channelId ID of the channel to fetch + * @param force Whether to force a fetch from the API + * @returns Promise that resolves with the fetched channel + */ + async fetch(channelId: string, force?: boolean): Promise { + if (!force) { + const existingChannel = this.client.channels.cache.get(channelId); + if (existingChannel) return existingChannel; + } - const data = await this.client.rest.router.channels.channelRead({ - channelId, - }); - const fetchedChannel = new (transformTypeToChannel(data.channel.type))(this.client, data.channel); - if (this.shouldCacheChannel) this.cache.set(fetchedChannel.id, fetchedChannel); - return fetchedChannel; - } + const data = await this.client.rest.router.channels.channelRead({ + channelId, + }); + const fetchedChannel = new (transformTypeToChannel(data.channel.type))(this.client, data.channel); + if (this.shouldCacheChannel) this.cache.set(fetchedChannel.id, fetchedChannel); + return fetchedChannel; + } - /** - * Update a channel by ID - * - * @param channelId ID of the channel to update - * @param options Channel update options - * @returns Promise that resolves with the updated channel - */ - async update(channelId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.channels.channelUpdate({ - channelId, - requestBody: options, - }); + /** + * Update a channel by ID + * + * @param channelId ID of the channel to update + * @param options Channel update options + * @returns Promise that resolves with the updated channel + */ + async update(channelId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.channels.channelUpdate({ + channelId, + requestBody: options, + }); - const existingChannel = this.cache.get(channelId); - if (existingChannel) return existingChannel._update(data.channel); + const existingChannel = this.cache.get(channelId); + if (existingChannel) return existingChannel._update(data.channel); - const newChannel = new (transformTypeToChannel(data.channel.type))(this.client, data.channel); - if (this.shouldCacheChannel) this.cache.set(newChannel.id, newChannel); - return newChannel; - } + const newChannel = new (transformTypeToChannel(data.channel.type))(this.client, data.channel); + if (this.shouldCacheChannel) this.cache.set(newChannel.id, newChannel); + return newChannel; + } - /** - * Delete a channel by ID - * - * @param channelId ID of the channel to delete - * @returns Promise that resolves with the deleted channel, or null if not cached. - */ - async delete(channelId: string): Promise { - await this.client.rest.router.channels.channelDelete({ channelId }); - const cachedChannel = this.cache.get(channelId); - return cachedChannel ?? null; - } + /** + * Delete a channel by ID + * + * @param channelId ID of the channel to delete + * @returns Promise that resolves with the deleted channel, or null if not cached. + */ + async delete(channelId: string): Promise { + await this.client.rest.router.channels.channelDelete({ + channelId, + }); + const cachedChannel = this.cache.get(channelId); + return cachedChannel ?? null; + } - /** - * Archive a channel by ID - * - * @param channelId ID of the channel to archive - * @returns Promise that resolves with the archived channel or null if not cached - */ - async archive(channelId: string): Promise { - await this.client.rest.router.channels.channelArchiveCreate({ channelId }); - const existingChannel = this.cache.get(channelId); - return existingChannel ?? null; - } + /** + * Archive a channel by ID + * + * @param channelId ID of the channel to archive + * @returns Promise that resolves with the archived channel or null if not cached + */ + async archive(channelId: string): Promise { + await this.client.rest.router.channels.channelArchiveCreate({ + channelId, + }); + const existingChannel = this.cache.get(channelId); + return existingChannel ?? null; + } - /** - * Unarchive a channel by ID - * - * @param channelId ID of the channel to unarchive - * @returns Promise that resolves with the unarchived channel or null if not cached - */ - async unarchive(channelId: string): Promise { - await this.client.rest.router.channels.channelArchiveDelete({ channelId }); - const existingChannel = this.cache.get(channelId); - return existingChannel ?? null; - } + /** + * Unarchive a channel by ID + * + * @param channelId ID of the channel to unarchive + * @returns Promise that resolves with the unarchived channel or null if not cached + */ + async unarchive(channelId: string): Promise { + await this.client.rest.router.channels.channelArchiveDelete({ + channelId, + }); + const existingChannel = this.cache.get(channelId); + return existingChannel ?? null; + } } /** @@ -123,8 +129,8 @@ export const transformTypeToChannel = (str: ServerChannelPayload["type"]): (type /** Mapping between the string APIChannelType and the corresponding channel class */ export const typeToChannel = { - chat: ChatChannel, - forums: ForumChannel, - docs: DocChannel, - list: ListChannel, + chat: ChatChannel, + forums: ForumChannel, + docs: DocChannel, + list: ListChannel, }; diff --git a/packages/guilded.js/lib/managers/global/DocManager.ts b/packages/guilded.js/lib/managers/global/DocManager.ts index 955b84a8..88408a15 100644 --- a/packages/guilded.js/lib/managers/global/DocManager.ts +++ b/packages/guilded.js/lib/managers/global/DocManager.ts @@ -6,72 +6,77 @@ import { GlobalManager } from "./GlobalManager"; * A manager class for Docs */ export class GlobalDocManager extends GlobalManager { - /** - * Create a new Doc. - * - * @param channelId - The ID of the channel where the Doc should be created. - * @param options - The options for the Doc to be created. - * @returns A Promise that resolves with the Doc payload of the newly created Doc. - */ - async create(channelId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.docs.docCreate({ - channelId, - requestBody: options, - }); - return data.doc; - } + /** + * Create a new Doc. + * + * @param channelId - The ID of the channel where the Doc should be created. + * @param options - The options for the Doc to be created. + * @returns A Promise that resolves with the Doc payload of the newly created Doc. + */ + async create(channelId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.docs.docCreate({ + channelId, + requestBody: options, + }); + return data.doc; + } - /** - * Fetches multiple Docs from a channel. - * - * @param channelId - The ID of the channel where the Docs are located. - * @returns A Promise that resolves with an array of Doc payloads. - */ - async fetchMany(channelId: string): Promise { - const data = await this.client.rest.router.docs.docReadMany({ channelId }); - return data.docs; - } + /** + * Fetches multiple Docs from a channel. + * + * @param channelId - The ID of the channel where the Docs are located. + * @returns A Promise that resolves with an array of Doc payloads. + */ + async fetchMany(channelId: string): Promise { + const data = await this.client.rest.router.docs.docReadMany({ + channelId, + }); + return data.docs; + } - /** - * Fetch a Doc from a channel. - * - * @param channelId - The ID of the channel where the Doc is located. - * @param docId - The ID of the Doc to fetch. - * @returns A Promise that resolves with the Doc payload of the fetched Doc. - */ - async fetch(channelId: string, docId: number): Promise { - const data = await this.client.rest.router.docs.docRead({ - channelId, - docId, - }); - return data.doc; - } + /** + * Fetch a Doc from a channel. + * + * @param channelId - The ID of the channel where the Doc is located. + * @param docId - The ID of the Doc to fetch. + * @returns A Promise that resolves with the Doc payload of the fetched Doc. + */ + async fetch(channelId: string, docId: number): Promise { + const data = await this.client.rest.router.docs.docRead({ + channelId, + docId, + }); + return data.doc; + } - /** - * Update a Doc. - * - * @param channelId - The ID of the channel where the Doc is located. - * @param docId - The ID of the Doc to update. - * @param options - The options for the Doc update. - * @returns A Promise that resolves with the Doc payload of the updated Doc. - */ - async update(channelId: string, docId: number, options: OptionBody): Promise { - const data = await this.client.rest.router.docs.docUpdate({ - channelId, - docId, - requestBody: options, - }); - return data.doc; - } + /** + * Update a Doc. + * + * @param channelId - The ID of the channel where the Doc is located. + * @param docId - The ID of the Doc to update. + * @param options - The options for the Doc update. + * @returns A Promise that resolves with the Doc payload of the updated Doc. + */ + async update(channelId: string, docId: number, options: OptionBody): Promise { + const data = await this.client.rest.router.docs.docUpdate({ + channelId, + docId, + requestBody: options, + }); + return data.doc; + } - /** - * Delete a Doc from a channel. - * - * @param channelId - The ID of the channel where the Doc is located. - * @param docId - The ID of the Doc to delete. - * @returns A Promise that resolves with void when the Doc is successfully deleted. - */ - async delete(channelId: string, docId: number): Promise { - await this.client.rest.router.docs.docDelete({ channelId, docId }); - } + /** + * Delete a Doc from a channel. + * + * @param channelId - The ID of the channel where the Doc is located. + * @param docId - The ID of the Doc to delete. + * @returns A Promise that resolves with void when the Doc is successfully deleted. + */ + async delete(channelId: string, docId: number): Promise { + await this.client.rest.router.docs.docDelete({ + channelId, + docId, + }); + } } diff --git a/packages/guilded.js/lib/managers/global/ForumManager.ts b/packages/guilded.js/lib/managers/global/ForumManager.ts index 51d682de..aa306b50 100644 --- a/packages/guilded.js/lib/managers/global/ForumManager.ts +++ b/packages/guilded.js/lib/managers/global/ForumManager.ts @@ -8,152 +8,152 @@ import { CacheableStructManager } from "./CacheableStructManager"; * Manager for interacting with forum topics at a global level. */ export class GlobalForumTopicManager extends CacheableStructManager { - get shouldCacheForumTopic(): boolean { - return this.client.options.cache?.cacheForumTopics !== false; - } + get shouldCacheForumTopic(): boolean { + return this.client.options.cache?.cacheForumTopics !== false; + } - /** - * Create a topic in a forum. - * - * @param channelId The ID of the channel containing the forum. - * @param options The options for creating the forum topic. - * @returns A Promise that resolves with the payload of the created forum topic. - */ - async create(channelId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.forums.forumTopicCreate({ - channelId, - requestBody: options, - }); - return new ForumTopic(this.client, data.forumTopic); - } + /** + * Create a topic in a forum. + * + * @param channelId The ID of the channel containing the forum. + * @param options The options for creating the forum topic. + * @returns A Promise that resolves with the payload of the created forum topic. + */ + async create(channelId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.forums.forumTopicCreate({ + channelId, + requestBody: options, + }); + return new ForumTopic(this.client, data.forumTopic); + } - /** - * Get all topics in a forum. - * - * @param channelId The ID of the channel containing the forum. - * @param options The options for filtering the forum topics. - * @returns A Promise that resolves to a Collection of ForumTopics. - */ - async fetchMany(channelId: string, options: Omit, "channelId">): Promise> { - const data = await this.client.rest.router.forums.forumTopicReadMany({ - channelId, - ...options, - }); + /** + * Get all topics in a forum. + * + * @param channelId The ID of the channel containing the forum. + * @param options The options for filtering the forum topics. + * @returns A Promise that resolves to a Collection of ForumTopics. + */ + async fetchMany(channelId: string, options: Omit, "channelId">): Promise> { + const data = await this.client.rest.router.forums.forumTopicReadMany({ + channelId, + ...options, + }); - const topics = new Collection(); - for (const forumTopic of data.forumTopics) { - const newTopic = new PartialForumTopic(this.client, forumTopic); - topics.set(newTopic.id, newTopic); - } + const topics = new Collection(); + for (const forumTopic of data.forumTopics) { + const newTopic = new PartialForumTopic(this.client, forumTopic); + topics.set(newTopic.id, newTopic); + } - return topics; - } + return topics; + } - /** - * Get a topic in a forum. - * - * @param channelId The ID of the channel containing the forum. - * @param forumTopicId The ID of the forum topic. - * @returns a Promise that resolves to a ForumTopic. - */ - async fetch(channelId: string, forumTopicId: number): Promise { - const data = await this.client.rest.router.forums.forumTopicRead({ - channelId, - forumTopicId, - }); - return new ForumTopic(this.client, data.forumTopic); - } + /** + * Get a topic in a forum. + * + * @param channelId The ID of the channel containing the forum. + * @param forumTopicId The ID of the forum topic. + * @returns a Promise that resolves to a ForumTopic. + */ + async fetch(channelId: string, forumTopicId: number): Promise { + const data = await this.client.rest.router.forums.forumTopicRead({ + channelId, + forumTopicId, + }); + return new ForumTopic(this.client, data.forumTopic); + } - /** - * Update a topic in a forum. - * - * @param channelId The ID of the channel containing the forum. - * @param forumTopicId The ID of the forum topic. - * @param options The options for updating the forum topic. - * @returns A Promise that resolves to the updated ForumTopic. If cached locally, it will modify that object. - */ - async update(channelId: string, forumTopicId: number, options: OptionBody): Promise { - const data = await this.client.rest.router.forums.forumTopicUpdate({ - channelId, - forumTopicId, - requestBody: options, - }); + /** + * Update a topic in a forum. + * + * @param channelId The ID of the channel containing the forum. + * @param forumTopicId The ID of the forum topic. + * @param options The options for updating the forum topic. + * @returns A Promise that resolves to the updated ForumTopic. If cached locally, it will modify that object. + */ + async update(channelId: string, forumTopicId: number, options: OptionBody): Promise { + const data = await this.client.rest.router.forums.forumTopicUpdate({ + channelId, + forumTopicId, + requestBody: options, + }); - const existingTopic = this.client.topics.cache.get(data.forumTopic.id); - if (existingTopic) return existingTopic._update(data.forumTopic); + const existingTopic = this.client.topics.cache.get(data.forumTopic.id); + if (existingTopic) return existingTopic._update(data.forumTopic); - const newTopic = new ForumTopic(this.client, data.forumTopic); - this.client.topics.cache.set(newTopic.id, newTopic); - return newTopic; - } + const newTopic = new ForumTopic(this.client, data.forumTopic); + this.client.topics.cache.set(newTopic.id, newTopic); + return newTopic; + } - /** - * Delete a topic in a forum. - * - * @param channelId The ID of the channel containing the forum. - * @param forumTopicId The ID of the forum topic. - * @returns A Promise that resolves to nothing. - */ - async delete(channelId: string, forumTopicId: number): Promise { - await this.client.rest.router.forums.forumTopicDelete({ - channelId, - forumTopicId, - }); - } + /** + * Delete a topic in a forum. + * + * @param channelId The ID of the channel containing the forum. + * @param forumTopicId The ID of the forum topic. + * @returns A Promise that resolves to nothing. + */ + async delete(channelId: string, forumTopicId: number): Promise { + await this.client.rest.router.forums.forumTopicDelete({ + channelId, + forumTopicId, + }); + } - /** - * Pin a topic in a forum. - * - * @param channelId The ID of the channel containing the forum. - * @param forumTopicId The ID of the forum topic. - * @returns A Promise that resolves to nothing. - */ - async pin(channelId: string, forumTopicId: number): Promise { - await this.client.rest.router.forums.forumTopicPin({ - channelId, - forumTopicId, - }); - } + /** + * Pin a topic in a forum. + * + * @param channelId The ID of the channel containing the forum. + * @param forumTopicId The ID of the forum topic. + * @returns A Promise that resolves to nothing. + */ + async pin(channelId: string, forumTopicId: number): Promise { + await this.client.rest.router.forums.forumTopicPin({ + channelId, + forumTopicId, + }); + } - /** - * Unpin a topic in a forum. - * - * @param channelId The ID of the channel containing the forum. - * @param forumTopicId The ID of the forum topic. - * @returns A Promise that resolves to nothing. - */ - async unpin(channelId: string, forumTopicId: number): Promise { - await this.client.rest.router.forums.forumTopicUnpin({ - channelId, - forumTopicId, - }); - } + /** + * Unpin a topic in a forum. + * + * @param channelId The ID of the channel containing the forum. + * @param forumTopicId The ID of the forum topic. + * @returns A Promise that resolves to nothing. + */ + async unpin(channelId: string, forumTopicId: number): Promise { + await this.client.rest.router.forums.forumTopicUnpin({ + channelId, + forumTopicId, + }); + } - /** - * Lock a topic in a forum. - * - * @param channelId The ID of the channel containing the forum. - * @param forumTopicId The ID of the forum topic. - * @returns A Promise that resolves to nothing. - */ - async lock(channelId: string, forumTopicId: number): Promise { - await this.client.rest.router.forums.forumTopicLock({ - channelId, - forumTopicId, - }); - } + /** + * Lock a topic in a forum. + * + * @param channelId The ID of the channel containing the forum. + * @param forumTopicId The ID of the forum topic. + * @returns A Promise that resolves to nothing. + */ + async lock(channelId: string, forumTopicId: number): Promise { + await this.client.rest.router.forums.forumTopicLock({ + channelId, + forumTopicId, + }); + } - /** - * Unlock a topic in a forum. - * - * @param channelId The ID of the channel containing the forum. - * @param forumTopicId The ID - * @returns A Promise that resolves to nothing. - */ - async unlock(channelId: string, forumTopicId: number): Promise { - await this.client.rest.router.forums.forumTopicUnlock({ - channelId, - forumTopicId, - }); - } + /** + * Unlock a topic in a forum. + * + * @param channelId The ID of the channel containing the forum. + * @param forumTopicId The ID + * @returns A Promise that resolves to nothing. + */ + async unlock(channelId: string, forumTopicId: number): Promise { + await this.client.rest.router.forums.forumTopicUnlock({ + channelId, + forumTopicId, + }); + } } diff --git a/packages/guilded.js/lib/managers/global/GlobalManager.ts b/packages/guilded.js/lib/managers/global/GlobalManager.ts index 67f17dbc..3987179f 100644 --- a/packages/guilded.js/lib/managers/global/GlobalManager.ts +++ b/packages/guilded.js/lib/managers/global/GlobalManager.ts @@ -4,5 +4,5 @@ import type { Client } from "../../structures/Client"; * Represents any manager. */ export class GlobalManager { - constructor(public readonly client: Client) {} + constructor(public readonly client: Client) {} } diff --git a/packages/guilded.js/lib/managers/global/GroupManager.ts b/packages/guilded.js/lib/managers/global/GroupManager.ts index 2247ccb0..d13b79cf 100644 --- a/packages/guilded.js/lib/managers/global/GroupManager.ts +++ b/packages/guilded.js/lib/managers/global/GroupManager.ts @@ -8,117 +8,120 @@ import { CacheableStructManager } from "./CacheableStructManager"; * Manager for interacting with Groups on Guilded. */ export class GlobalGroupManager extends CacheableStructManager { - /** - * Creates a group. - * - * @param serverId The ID of the server to create the group in. - * @param options The options for the group to create. - * @returns A Promise that resolves with the created group. - */ - async create(serverId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.groups.groupCreate({ - serverId, - requestBody: options, - }); - const createdGroup = new Group(this.client, data.group); - this.cache.set(createdGroup.id, createdGroup); - return createdGroup; - } + /** + * Creates a group. + * + * @param serverId The ID of the server to create the group in. + * @param options The options for the group to create. + * @returns A Promise that resolves with the created group. + */ + async create(serverId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.groups.groupCreate({ + serverId, + requestBody: options, + }); + const createdGroup = new Group(this.client, data.group); + this.cache.set(createdGroup.id, createdGroup); + return createdGroup; + } - /** - * Fetch a group - * - * @param serverId The ID of the server to fetch the group from. - * @param groupId The ID of the group to fetch. - * @returns A Promise that resolves with the fetched group. - */ - async fetch(serverId: string, groupId: string): Promise { - const data = await this.client.rest.router.groups.groupRead({ - serverId, - groupId, - }); - const fetchedGroup = new Group(this.client, data.group); - this.cache.set(fetchedGroup.id, fetchedGroup); - return fetchedGroup; - } + /** + * Fetch a group + * + * @param serverId The ID of the server to fetch the group from. + * @param groupId The ID of the group to fetch. + * @returns A Promise that resolves with the fetched group. + */ + async fetch(serverId: string, groupId: string): Promise { + const data = await this.client.rest.router.groups.groupRead({ + serverId, + groupId, + }); + const fetchedGroup = new Group(this.client, data.group); + this.cache.set(fetchedGroup.id, fetchedGroup); + return fetchedGroup; + } - /** - * Fetch all the groups in a server - * - * @param serverId The ID of the server to fetch the groups from. - * @returns A Promise that resolves a Collection containing the fetched groups. - */ - async fetchMany(serverId: string): Promise> { - const data = await this.client.rest.router.groups.groupReadMany({ - serverId, - }); - const groups = new Collection(); + /** + * Fetch all the groups in a server + * + * @param serverId The ID of the server to fetch the groups from. + * @returns A Promise that resolves a Collection containing the fetched groups. + */ + async fetchMany(serverId: string): Promise> { + const data = await this.client.rest.router.groups.groupReadMany({ + serverId, + }); + const groups = new Collection(); - for (const group of data.groups) { - const fetchedGroup = new Group(this.client, group); - this.cache.set(fetchedGroup.id, fetchedGroup); - groups.set(fetchedGroup.id, fetchedGroup); - } + for (const group of data.groups) { + const fetchedGroup = new Group(this.client, group); + this.cache.set(fetchedGroup.id, fetchedGroup); + groups.set(fetchedGroup.id, fetchedGroup); + } - return groups; - } + return groups; + } - /** - * Update a group - * - * @param serverId The ID of the server to update the group in. - * @param groupId The ID of the group to update. - * @param options The options to update the group with. - * @returns A Promise that resolves with the updated group. - */ - async update(serverId: string, groupId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.groups.groupUpdate({ - serverId, - groupId, - requestBody: options, - }); - let group = this.cache.get(data.group.id)?._update(data.group); - group ??= new Group(this.client, data.group); - return group; - } + /** + * Update a group + * + * @param serverId The ID of the server to update the group in. + * @param groupId The ID of the group to update. + * @param options The options to update the group with. + * @returns A Promise that resolves with the updated group. + */ + async update(serverId: string, groupId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.groups.groupUpdate({ + serverId, + groupId, + requestBody: options, + }); + let group = this.cache.get(data.group.id)?._update(data.group); + group ??= new Group(this.client, data.group); + return group; + } - /** - * Delete a group - * - * @param serverId The ID of the server to delete the group from. - * @param groupId The ID of the group to delete. - * @returns A Promise that resolves when the operation is complete. - */ - async delete(serverId: string, groupId: string): Promise { - await this.client.rest.router.groups.groupDelete({ serverId, groupId }); - if (this.cache.has(groupId)) this.cache.delete(groupId); - } + /** + * Delete a group + * + * @param serverId The ID of the server to delete the group from. + * @param groupId The ID of the group to delete. + * @returns A Promise that resolves when the operation is complete. + */ + async delete(serverId: string, groupId: string): Promise { + await this.client.rest.router.groups.groupDelete({ + serverId, + groupId, + }); + if (this.cache.has(groupId)) this.cache.delete(groupId); + } - /** - * Adds a member to a group. - * - * @param groupId The ID of the group. - * @param userId The ID of the user to add. - * @returns A Promise that resolves when the operation is complete. - */ - async addMember(groupId: string, userId: string): Promise { - await this.client.rest.router.groupMembership.groupMembershipCreate({ - groupId, - userId, - }); - } + /** + * Adds a member to a group. + * + * @param groupId The ID of the group. + * @param userId The ID of the user to add. + * @returns A Promise that resolves when the operation is complete. + */ + async addMember(groupId: string, userId: string): Promise { + await this.client.rest.router.groupMembership.groupMembershipCreate({ + groupId, + userId, + }); + } - /** - * Removes a member from a group. - * - * @param groupId The ID of the group. - * @param userId The ID of the user to remove. - * @returns A Promise that resolves when the operation is complete. - */ - async removeMember(groupId: string, userId: string): Promise { - await this.client.rest.router.groupMembership.groupMembershipDelete({ - groupId, - userId, - }); - } + /** + * Removes a member from a group. + * + * @param groupId The ID of the group. + * @param userId The ID of the user to remove. + * @returns A Promise that resolves when the operation is complete. + */ + async removeMember(groupId: string, userId: string): Promise { + await this.client.rest.router.groupMembership.groupMembershipDelete({ + groupId, + userId, + }); + } } diff --git a/packages/guilded.js/lib/managers/global/GuildBanManager.ts b/packages/guilded.js/lib/managers/global/GuildBanManager.ts index a8796366..6060a65a 100644 --- a/packages/guilded.js/lib/managers/global/GuildBanManager.ts +++ b/packages/guilded.js/lib/managers/global/GuildBanManager.ts @@ -7,92 +7,98 @@ import { CacheableStructManager } from "./CacheableStructManager"; * Manages guild bans in all servers. */ export class GlobalGuildBanManager extends CacheableStructManager { - /** - * Returns whether bans should be cached. - */ - get shouldCacheBan(): boolean { - return this.client.options.cache?.cacheMemberBans !== false; - } + /** + * Returns whether bans should be cached. + */ + get shouldCacheBan(): boolean { + return this.client.options.cache?.cacheMemberBans !== false; + } - /** - * Fetches a member ban in a server. - * - * @param serverId The ID of the server. - * @param userId The ID of the user. - * @param force Whether to force fetch the ban even if it's cached. - * @returns A Promise that resolves with the fetched member ban. - */ - async fetch(serverId: string, userId: string, force?: boolean): Promise { - if (!force) { - const existingMemberBan = this.client.bans.cache.get(buildMemberKey(serverId, userId)); - if (existingMemberBan) return existingMemberBan; - } + /** + * Fetches a member ban in a server. + * + * @param serverId The ID of the server. + * @param userId The ID of the user. + * @param force Whether to force fetch the ban even if it's cached. + * @returns A Promise that resolves with the fetched member ban. + */ + async fetch(serverId: string, userId: string, force?: boolean): Promise { + if (!force) { + const existingMemberBan = this.client.bans.cache.get(buildMemberKey(serverId, userId)); + if (existingMemberBan) return existingMemberBan; + } - const data = await this.client.rest.router.memberBans.serverMemberBanRead({ - serverId, - userId, - }); - const newMemberBan = new MemberBan(this.client, { - ...data.serverMemberBan, - serverId, - }); - if (this.shouldCacheBan) this.client.bans.cache.set(newMemberBan.id, newMemberBan); - return newMemberBan; - } + const data = await this.client.rest.router.memberBans.serverMemberBanRead({ + serverId, + userId, + }); + const newMemberBan = new MemberBan(this.client, { + ...data.serverMemberBan, + serverId, + }); + if (this.shouldCacheBan) this.client.bans.cache.set(newMemberBan.id, newMemberBan); + return newMemberBan; + } - /** - * Fetches all bans in a server. - * - * @param serverId The ID of the server. - * @returns A Promise that resolves with a collection of the fetched member bans. - */ - async fetchMany(serverId: string): Promise> { - const data = await this.client.rest.router.memberBans.serverMemberBanReadMany({ - serverId, - }); - const newMemberBans = new Collection(); - for (const ban of data.serverMemberBans) { - const newMemberBan = new MemberBan(this.client, { serverId, ...ban }); - newMemberBans.set(newMemberBan.id, newMemberBan); - if (this.shouldCacheBan) this.client.bans.cache.set(newMemberBan.id, newMemberBan); - } + /** + * Fetches all bans in a server. + * + * @param serverId The ID of the server. + * @returns A Promise that resolves with a collection of the fetched member bans. + */ + async fetchMany(serverId: string): Promise> { + const data = await this.client.rest.router.memberBans.serverMemberBanReadMany({ + serverId, + }); + const newMemberBans = new Collection(); + for (const ban of data.serverMemberBans) { + const newMemberBan = new MemberBan(this.client, { + serverId, + ...ban, + }); + newMemberBans.set(newMemberBan.id, newMemberBan); + if (this.shouldCacheBan) this.client.bans.cache.set(newMemberBan.id, newMemberBan); + } - return newMemberBans; - } + return newMemberBans; + } - /** - * Bans a user from a server. - * - * @param serverId The ID of the server. - * @param userId The ID of the user. - * @returns A Promise that resolves with the newly created member ban. - */ - async ban(serverId: string, userId: string): Promise { - const data = await this.client.rest.router.memberBans.serverMemberBanCreate({ serverId, userId }); - const newMemberBan = new MemberBan(this.client, { - serverId, - ...data.serverMemberBan, - }); - if (this.shouldCacheBan) this.client.bans.cache.set(newMemberBan.id, newMemberBan); - return newMemberBan; - } + /** + * Bans a user from a server. + * + * @param serverId The ID of the server. + * @param userId The ID of the user. + * @returns A Promise that resolves with the newly created member ban. + */ + async ban(serverId: string, userId: string): Promise { + const data = await this.client.rest.router.memberBans.serverMemberBanCreate({ + serverId, + userId, + }); + const newMemberBan = new MemberBan(this.client, { + serverId, + ...data.serverMemberBan, + }); + if (this.shouldCacheBan) this.client.bans.cache.set(newMemberBan.id, newMemberBan); + return newMemberBan; + } - /** - * Unbans a user from a server. - * - * @param serverId The ID of the server. - * @param userId The ID of the user. - * @param removeBanIfCached Whether to remove the ban from the cache if it exists. - * @returns A Promise that resolves with the unbanned member ban or `null` if it isn't cached. - */ - async unban(serverId: string, userId: string, removeBanIfCached = false): Promise { - await this.client.rest.router.memberBans.serverMemberBanDelete({ - serverId, - userId, - }); - const memberKey = buildMemberKey(serverId, userId); - const existingBan = this.client.bans.cache.get(memberKey); - if (this.client.options.cache?.removeMemberBanOnUnban || removeBanIfCached) this.client.bans.cache.delete(memberKey); - return existingBan ?? null; - } + /** + * Unbans a user from a server. + * + * @param serverId The ID of the server. + * @param userId The ID of the user. + * @param removeBanIfCached Whether to remove the ban from the cache if it exists. + * @returns A Promise that resolves with the unbanned member ban or `null` if it isn't cached. + */ + async unban(serverId: string, userId: string, removeBanIfCached = false): Promise { + await this.client.rest.router.memberBans.serverMemberBanDelete({ + serverId, + userId, + }); + const memberKey = buildMemberKey(serverId, userId); + const existingBan = this.client.bans.cache.get(memberKey); + if (this.client.options.cache?.removeMemberBanOnUnban || removeBanIfCached) this.client.bans.cache.delete(memberKey); + return existingBan ?? null; + } } diff --git a/packages/guilded.js/lib/managers/global/ListManager.ts b/packages/guilded.js/lib/managers/global/ListManager.ts index bf982034..1ab60f08 100644 --- a/packages/guilded.js/lib/managers/global/ListManager.ts +++ b/packages/guilded.js/lib/managers/global/ListManager.ts @@ -6,105 +6,105 @@ import { GlobalManager } from "./GlobalManager"; * A class representing a manager for list items at a global level. */ export class GlobalListItemManager extends GlobalManager { - /** - * Creates a new list item. - * - * @param channelId The ID of the channel to create the list item in. - * @param options Additional options for the list item. - * @returns A Promise that resolves with the newly created list item. - */ - async create(channelId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.listItems.listItemCreate({ - channelId, - requestBody: options, - }); - return data.listItem; - } + /** + * Creates a new list item. + * + * @param channelId The ID of the channel to create the list item in. + * @param options Additional options for the list item. + * @returns A Promise that resolves with the newly created list item. + */ + async create(channelId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.listItems.listItemCreate({ + channelId, + requestBody: options, + }); + return data.listItem; + } - /** - * Fetches multiple list items. - * - * @param channelId The ID of the channel to fetch the list items from. - * @returns A Promise that resolves with an array of list item summaries. - */ - async fetchMany(channelId: string): Promise { - const data = await this.client.rest.router.listItems.listItemReadMany({ - channelId, - }); - return data.listItems; - } + /** + * Fetches multiple list items. + * + * @param channelId The ID of the channel to fetch the list items from. + * @returns A Promise that resolves with an array of list item summaries. + */ + async fetchMany(channelId: string): Promise { + const data = await this.client.rest.router.listItems.listItemReadMany({ + channelId, + }); + return data.listItems; + } - /** - * Fetches a single list item. - * - * @param channelId The ID of the channel that the list item belongs to. - * @param listItemId The ID of the list item to fetch. - * @returns A Promise that resolves with the requested list item. - */ - async fetch(channelId: string, listItemId: string): Promise { - const data = await this.client.rest.router.listItems.listItemRead({ - channelId, - listItemId, - }); - return data.listItem; - } + /** + * Fetches a single list item. + * + * @param channelId The ID of the channel that the list item belongs to. + * @param listItemId The ID of the list item to fetch. + * @returns A Promise that resolves with the requested list item. + */ + async fetch(channelId: string, listItemId: string): Promise { + const data = await this.client.rest.router.listItems.listItemRead({ + channelId, + listItemId, + }); + return data.listItem; + } - /** - * Updates a list item. - * - * @param channelId The ID of the channel that the list item belongs to. - * @param listItemId The ID of the list item to update. - * @param options Additional options for the updated list item. - * @returns A Promise that resolves with the updated list item. - */ - async update(channelId: string, listItemId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.listItems.listItemUpdate({ - channelId, - listItemId, - requestBody: options, - }); - return data.listItem; - } + /** + * Updates a list item. + * + * @param channelId The ID of the channel that the list item belongs to. + * @param listItemId The ID of the list item to update. + * @param options Additional options for the updated list item. + * @returns A Promise that resolves with the updated list item. + */ + async update(channelId: string, listItemId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.listItems.listItemUpdate({ + channelId, + listItemId, + requestBody: options, + }); + return data.listItem; + } - /** - * Deletes a list item. - * - * @param channelId The ID of the channel that the list item belongs to. - * @param listItemId The ID of the list item to delete. - * @returns A Promise that resolves with no value upon successful deletion. - */ - async delete(channelId: string, listItemId: string): Promise { - await this.client.rest.router.listItems.listItemDelete({ - channelId, - listItemId, - }); - } + /** + * Deletes a list item. + * + * @param channelId The ID of the channel that the list item belongs to. + * @param listItemId The ID of the list item to delete. + * @returns A Promise that resolves with no value upon successful deletion. + */ + async delete(channelId: string, listItemId: string): Promise { + await this.client.rest.router.listItems.listItemDelete({ + channelId, + listItemId, + }); + } - /** - * Marks a list item as complete. - * - * @param channelId The ID of the channel that the list item belongs to. - * @param listItemId The ID of the list item to mark as complete. - * @returns A Promise that resolves with no value upon successful completion. - */ - async complete(channelId: string, listItemId: string): Promise { - await this.client.rest.router.listItems.listItemCompleteCreate({ - channelId, - listItemId, - }); - } + /** + * Marks a list item as complete. + * + * @param channelId The ID of the channel that the list item belongs to. + * @param listItemId The ID of the list item to mark as complete. + * @returns A Promise that resolves with no value upon successful completion. + */ + async complete(channelId: string, listItemId: string): Promise { + await this.client.rest.router.listItems.listItemCompleteCreate({ + channelId, + listItemId, + }); + } - /** - * Marks a completed list item as incomplete. - * - * @param channelId The ID of the channel that the list item belongs to. - * @param listItemId The ID of the completed list item to mark as incomplete. - * @returns A Promise that resolves with no value upon successful uncompletion. - */ - async uncomplete(channelId: string, listItemId: string): Promise { - await this.client.rest.router.listItems.listItemCompleteDelete({ - channelId, - listItemId, - }); - } + /** + * Marks a completed list item as incomplete. + * + * @param channelId The ID of the channel that the list item belongs to. + * @param listItemId The ID of the completed list item to mark as incomplete. + * @returns A Promise that resolves with no value upon successful uncompletion. + */ + async uncomplete(channelId: string, listItemId: string): Promise { + await this.client.rest.router.listItems.listItemCompleteDelete({ + channelId, + listItemId, + }); + } } diff --git a/packages/guilded.js/lib/managers/global/MemberManager.ts b/packages/guilded.js/lib/managers/global/MemberManager.ts index 98b33cbd..b2b76c9e 100644 --- a/packages/guilded.js/lib/managers/global/MemberManager.ts +++ b/packages/guilded.js/lib/managers/global/MemberManager.ts @@ -11,180 +11,188 @@ import { CacheableStructManager } from "./CacheableStructManager"; * */ export class GlobalMemberManager extends CacheableStructManager { - /** - * Whether or not social links should be cached. - */ - get shouldCacheSocialLinks(): boolean { - return this.client.options.cache?.cacheSocialLinks !== false; - } + /** + * Whether or not social links should be cached. + */ + get shouldCacheSocialLinks(): boolean { + return this.client.options.cache?.cacheSocialLinks !== false; + } - /** - * Fetches a member from a server. - * - * @param serverId The ID of the server to fetch the member from. - * @param userId The ID of the member to fetch. - * @param force Whether to force a fetch from the API. - * @returns A Promise that resolves with the fetched member. - */ - async fetch(serverId: string, userId: string, force?: boolean): Promise { - if (userId === "Ann6LewA") throw new Error("You cannot fetch a webhook as a member. The provided ID (Ann6LewA) is only given to webhooks."); + /** + * Fetches a member from a server. + * + * @param serverId The ID of the server to fetch the member from. + * @param userId The ID of the member to fetch. + * @param force Whether to force a fetch from the API. + * @returns A Promise that resolves with the fetched member. + */ + async fetch(serverId: string, userId: string, force?: boolean): Promise { + if (userId === "Ann6LewA") throw new Error("You cannot fetch a webhook as a member. The provided ID (Ann6LewA) is only given to webhooks."); - const memberKey = buildMemberKey(serverId, userId); - if (!force) { - const existingMember = this.client.members.cache.get(memberKey); - if (existingMember) return existingMember; - } + const memberKey = buildMemberKey(serverId, userId); + if (!force) { + const existingMember = this.client.members.cache.get(memberKey); + if (existingMember) return existingMember; + } - const data = await this.client.rest.router.members.serverMemberRead({ - serverId, - userId, - }); - const newMember = new Member(this.client, { - ...data.member, - serverId, - id: data.member.user.id, - }); - this.client.users.cache.set(data.member.user.id, new User(this.client, data.member.user)); - this.client.members.cache.set(memberKey, newMember); - return newMember; - } + const data = await this.client.rest.router.members.serverMemberRead({ + serverId, + userId, + }); + const newMember = new Member(this.client, { + ...data.member, + serverId, + id: data.member.user.id, + }); + this.client.users.cache.set(data.member.user.id, new User(this.client, data.member.user)); + this.client.members.cache.set(memberKey, newMember); + return newMember; + } - /** - * Fetches all members from a server. Returned objects are partial members. - * - * @param serverId The ID of the server to fetch members from. - * @returns A Promise that resolves with a collection of partial members. - */ - async fetchMany(serverId: string): Promise> { - const data = await this.client.rest.router.members.serverMemberReadMany({ - serverId, - }); - const members = new Collection(); - for (const member of data.members) { - const newMember = new PartialMember(this.client, { - serverId, - id: member.user.id, - ...member, - }); - members.set(newMember.id, newMember); - } + /** + * Fetches all members from a server. Returned objects are partial members. + * + * @param serverId The ID of the server to fetch members from. + * @returns A Promise that resolves with a collection of partial members. + */ + async fetchMany(serverId: string): Promise> { + const data = await this.client.rest.router.members.serverMemberReadMany({ + serverId, + }); + const members = new Collection(); + for (const member of data.members) { + const newMember = new PartialMember(this.client, { + serverId, + id: member.user.id, + ...member, + }); + members.set(newMember.id, newMember); + } - return members; - } + return members; + } - /** - * Kicks a member from a server. - * - * @param serverId The ID of the server to kick the member from. - * @param userId The ID of the member to kick. - * @returns A Promise that resolves with the kicked member, or null if the member was not cached. - */ - async kick(serverId: string, userId: string): Promise { - await this.client.rest.router.members.serverMemberDelete({ - serverId, - userId, - }); - return this.client.members.cache.get(buildMemberKey(serverId, userId)) ?? null; - } + /** + * Kicks a member from a server. + * + * @param serverId The ID of the server to kick the member from. + * @param userId The ID of the member to kick. + * @returns A Promise that resolves with the kicked member, or null if the member was not cached. + */ + async kick(serverId: string, userId: string): Promise { + await this.client.rest.router.members.serverMemberDelete({ + serverId, + userId, + }); + return this.client.members.cache.get(buildMemberKey(serverId, userId)) ?? null; + } - /** - * Bans a member from a server. - * - * @param serverId The ID of the server to ban the member from. - * @param userId The ID of the user to ban. - * @returns A Promise that resolves with the banned member, or null if the member was not cached. - */ - async ban(serverId: string, userId: string): Promise { - return this.client.bans.ban(serverId, userId); - } + /** + * Bans a member from a server. + * + * @param serverId The ID of the server to ban the member from. + * @param userId The ID of the user to ban. + * @returns A Promise that resolves with the banned member, or null if the member was not cached. + */ + async ban(serverId: string, userId: string): Promise { + return this.client.bans.ban(serverId, userId); + } - /** - * Unbans a user from a server. - * - * @param serverId The ID of the server. - * @param userId The ID of the user. - * @param removeBanIfCached Whether to remove the ban from the cache if it exists. - * @returns A Promise that resolves with the unbanned member ban or `null` if it isn't cached. - */ - async unban(serverId: string, userId: string, removeBanIfCached = false): Promise { - return this.client.bans.unban(serverId, userId, removeBanIfCached); - } + /** + * Unbans a user from a server. + * + * @param serverId The ID of the server. + * @param userId The ID of the user. + * @param removeBanIfCached Whether to remove the ban from the cache if it exists. + * @returns A Promise that resolves with the unbanned member ban or `null` if it isn't cached. + */ + async unban(serverId: string, userId: string, removeBanIfCached = false): Promise { + return this.client.bans.unban(serverId, userId, removeBanIfCached); + } - /** - * Gets a list of the roles assigned to a member using the ID of the member. - * - * @param serverId The ID of the server to get the member roles from. - * @param userId The ID of the member to get the roles for. - * @returns A Promise that resolves with an array of role IDs. - */ - async getRoles(serverId: string, userId: string): Promise { - const data = await this.client.rest.router.roleMembership.roleMembershipReadMany({ - serverId, - userId, - }); - return data.roleIds; - } + /** + * Gets a list of the roles assigned to a member using the ID of the member. + * + * @param serverId The ID of the server to get the member roles from. + * @param userId The ID of the member to get the roles for. + * @returns A Promise that resolves with an array of role IDs. + */ + async getRoles(serverId: string, userId: string): Promise { + const data = await this.client.rest.router.roleMembership.roleMembershipReadMany({ + serverId, + userId, + }); + return data.roleIds; + } - /** - * Updates a member's nickname. Returns the new name. - * - * @param serverId The ID of the server to update the member nickname for. - * @param userId The ID of the member to update the nickname for. - * @param newNickname The new nickname for the member. - * @returns A Promise that resolves with the updated nickname. - */ - async updateNickname(serverId: string, userId: string, newNickname: string): Promise { - const data = await this.client.rest.router.members.memberNicknameUpdate({ - serverId, - userId, - requestBody: { nickname: newNickname }, - }); - return data.nickname; - } + /** + * Updates a member's nickname. Returns the new name. + * + * @param serverId The ID of the server to update the member nickname for. + * @param userId The ID of the member to update the nickname for. + * @param newNickname The new nickname for the member. + * @returns A Promise that resolves with the updated nickname. + */ + async updateNickname(serverId: string, userId: string, newNickname: string): Promise { + const data = await this.client.rest.router.members.memberNicknameUpdate({ + serverId, + userId, + requestBody: { + nickname: newNickname, + }, + }); + return data.nickname; + } - /** - * Deletes a member's nickname. - * - * @param serverId The ID of the server to delete the member nickname from. - * @param userId The ID of the member to delete the nickname for. - * @returns A Promise that resolves with no value upon completion. - */ - async resetNickname(serverId: string, userId: string): Promise { - await this.client.rest.router.members.memberNicknameDelete({ - serverId, - userId, - }); - } + /** + * Deletes a member's nickname. + * + * @param serverId The ID of the server to delete the member nickname from. + * @param userId The ID of the member to delete the nickname for. + * @returns A Promise that resolves with no value upon completion. + */ + async resetNickname(serverId: string, userId: string): Promise { + await this.client.rest.router.members.memberNicknameDelete({ + serverId, + userId, + }); + } - /** - * Awards XP to a member. - * - * @param serverId The ID of the server to award XP on. - * @param userId The ID of the member to award XP to. - * @param amount The amount of XP to award. - * @returns A Promise that resolves with the member's new total XP. - */ - async giveXP(serverId: string, userId: string, amount: number): Promise { - const data = await this.client.rest.router.serverXp.serverXpForUserCreate({ - serverId, - userId, - requestBody: { amount }, - }); - return data.total; - } + /** + * Awards XP to a member. + * + * @param serverId The ID of the server to award XP on. + * @param userId The ID of the member to award XP to. + * @param amount The amount of XP to award. + * @returns A Promise that resolves with the member's new total XP. + */ + async giveXP(serverId: string, userId: string, amount: number): Promise { + const data = await this.client.rest.router.serverXp.serverXpForUserCreate({ + serverId, + userId, + requestBody: { + amount, + }, + }); + return data.total; + } - /** - * Fetch a member's social links. - * - * @param serverId The ID of the server. - * @param userId The ID of the member. - * @param type The type of social link to fetch. - * @returns A Promise that resolves with the member's social link. - */ - async fetchSocialLinks(serverId: string, userId: string, type: SocialLinkPayload["type"]): Promise { - const data = await this.client.rest.router.socialLinks.memberSocialLinkRead({ serverId, userId, socialLinkType: type }); - const existingMember = this.cache.get(buildMemberKey(serverId, userId)); - if (this.shouldCacheSocialLinks) existingMember?.socialLinks.set(data.socialLink.type, data.socialLink); - return data.socialLink; - } + /** + * Fetch a member's social links. + * + * @param serverId The ID of the server. + * @param userId The ID of the member. + * @param type The type of social link to fetch. + * @returns A Promise that resolves with the member's social link. + */ + async fetchSocialLinks(serverId: string, userId: string, type: SocialLinkPayload["type"]): Promise { + const data = await this.client.rest.router.socialLinks.memberSocialLinkRead({ + serverId, + userId, + socialLinkType: type, + }); + const existingMember = this.cache.get(buildMemberKey(serverId, userId)); + if (this.shouldCacheSocialLinks) existingMember?.socialLinks.set(data.socialLink.type, data.socialLink); + return data.socialLink; + } } diff --git a/packages/guilded.js/lib/managers/global/MessageManager.ts b/packages/guilded.js/lib/managers/global/MessageManager.ts index d74086f1..fc2ffd85 100644 --- a/packages/guilded.js/lib/managers/global/MessageManager.ts +++ b/packages/guilded.js/lib/managers/global/MessageManager.ts @@ -11,150 +11,150 @@ import { CacheableStructManager } from "./CacheableStructManager"; * Manager for handling caching and interactions for Messages */ export class GlobalMessageManager extends CacheableStructManager { - /** - * Whether or not messages should be cached. - */ - get shouldCacheMessage(): boolean { - return this.client.options.cache?.cacheMessages !== false; - } - - /** - * Fetches multiple messages from a channel. - * - * @param channelId The ID of the channel to fetch messages from. - * @param options Additional options for the fetch. - * @returns A promise that resolves with a collection of messages. - */ - async fetchMany(channelId: string, options: Omit, "channelId">): Promise> { - const data = await this.client.rest.router.chat.channelMessageReadMany({ - channelId, - ...options, - }); - const messages = new Collection(); - - for (const message of data.messages) { - const newMessage = new Message(this.client, message); - messages.set(newMessage.id, newMessage); - } - - return messages; - } - - /** - * Fetches a message from a channel. - * - * @param channelId The ID of the channel to fetch the message from. - * @param messageId The ID of the message to fetch. - * @param force Whether or not to force the fetch. - * @returns A promise that resolves with the requested message. - */ - async fetch(channelId: string, messageId: string, force?: boolean): Promise { - if (!force) { - const existingMessage = this.client.messages.cache.get(messageId); - if (existingMessage) return existingMessage; - } - - const data = await this.client.rest.router.chat.channelMessageRead({ - channelId, - messageId, - }); - const newMessage = new Message(this.client, data.message); - this.client.messages.cache.set(newMessage.id, newMessage); - return newMessage; - } - - /** - * Sends a message to a channel. - * - * @param channelId The ID of the channel to send the message to. - * @param content The content of the message. - * @returns A promise that resolves with the created message. - * @example - * let replyObj = { - * content: 'This is text, supports **markdown**.', - * embeds: [{ - * title: 'This is an embed title!', - * description: 'A description may go here' - * }] - * }; - * await message.client.messages.send(message.channelId, replyObj) - */ - async send(channelId: string, content: MessageContent): Promise { - const data = await this.client.rest.router.chat.channelMessageCreate({ - channelId, - requestBody: resolveContentToData(content), - }); - - const existingMessage = this.client.messages.cache.get(data.message.id); - if (existingMessage) return existingMessage; - - const newMessage = new Message(this.client, data.message); - this.client.messages.cache.set(newMessage.id, newMessage); - return newMessage; - } - - /** - * Adds a reaction to a message. - * - * @param channelId The ID of the channel containing the message. - * @param contentId The ID of the message to add a reaction to. - * @param emoteId The ID of the emote to add as a reaction. - * @returns A promise that resolves to nothing when the reaction is added. - */ - async addReaction(channelId: string, contentId: string, emoteId: number): Promise { - await this.client.reactions.create(channelId, contentId, emoteId); - } - - /** - * Deletes either a whole reaction emote from a message or a specific user's if a userId is provided. - * - * @param channelId The ID of the channel containing the message. - * @param contentId The ID of the message to delete the reaction from. - * @param emoteId The ID of the emote to delete as a reaction. - * @returns A promise that resolves to nothing when the reaction is deleted. - */ - async deleteReaction(channelId: string, contentId: string, emoteId: number, userId?: string): Promise { - await this.client.reactions.delete(channelId, contentId, emoteId, userId); - } - - /** - * Updates a message in a channel. - * - * @param channelId The ID of the channel containing the message. - * @param messageId The ID of the message to update. - * @param content The new content of the message. - * @returns A promise that resolves with the updated message. - */ - async update(channelId: string, messageId: string, content: MessageContent): Promise { - const data = await this.client.rest.router.chat.channelMessageUpdate({ - channelId, - messageId, - requestBody: resolveContentToData(content), - }); - - const existingMessage = this.client.messages.cache.get(data.message.id); - if (existingMessage) return existingMessage._update(data.message); - - const newMessage = new Message(this.client, data.message); - this.client.messages.cache.set(newMessage.id, newMessage); - return newMessage; - } - - /** Delete a channel message. */ - async delete(channelId: string, messageId: string): Promise { - await this.client.rest.router.chat.channelMessageDelete({ - channelId, - messageId, - }); - } - - async awaitMessages(channelId: string, options: CollectorOptions): Promise> { - return new MessageCollector(this.client, { - ...options, - filter: (item): MaybePromise => { - if (item.channelId !== channelId) return false; - return options.filter?.(item) ?? true; - }, - }).start(); - } + /** + * Whether or not messages should be cached. + */ + get shouldCacheMessage(): boolean { + return this.client.options.cache?.cacheMessages !== false; + } + + /** + * Fetches multiple messages from a channel. + * + * @param channelId The ID of the channel to fetch messages from. + * @param options Additional options for the fetch. + * @returns A promise that resolves with a collection of messages. + */ + async fetchMany(channelId: string, options: Omit, "channelId">): Promise> { + const data = await this.client.rest.router.chat.channelMessageReadMany({ + channelId, + ...options, + }); + const messages = new Collection(); + + for (const message of data.messages) { + const newMessage = new Message(this.client, message); + messages.set(newMessage.id, newMessage); + } + + return messages; + } + + /** + * Fetches a message from a channel. + * + * @param channelId The ID of the channel to fetch the message from. + * @param messageId The ID of the message to fetch. + * @param force Whether or not to force the fetch. + * @returns A promise that resolves with the requested message. + */ + async fetch(channelId: string, messageId: string, force?: boolean): Promise { + if (!force) { + const existingMessage = this.client.messages.cache.get(messageId); + if (existingMessage) return existingMessage; + } + + const data = await this.client.rest.router.chat.channelMessageRead({ + channelId, + messageId, + }); + const newMessage = new Message(this.client, data.message); + this.client.messages.cache.set(newMessage.id, newMessage); + return newMessage; + } + + /** + * Sends a message to a channel. + * + * @param channelId The ID of the channel to send the message to. + * @param content The content of the message. + * @returns A promise that resolves with the created message. + * @example + * let replyObj = { + * content: 'This is text, supports **markdown**.', + * embeds: [{ + * title: 'This is an embed title!', + * description: 'A description may go here' + * }] + * }; + * await message.client.messages.send(message.channelId, replyObj) + */ + async send(channelId: string, content: MessageContent): Promise { + const data = await this.client.rest.router.chat.channelMessageCreate({ + channelId, + requestBody: resolveContentToData(content), + }); + + const existingMessage = this.client.messages.cache.get(data.message.id); + if (existingMessage) return existingMessage; + + const newMessage = new Message(this.client, data.message); + this.client.messages.cache.set(newMessage.id, newMessage); + return newMessage; + } + + /** + * Adds a reaction to a message. + * + * @param channelId The ID of the channel containing the message. + * @param contentId The ID of the message to add a reaction to. + * @param emoteId The ID of the emote to add as a reaction. + * @returns A promise that resolves to nothing when the reaction is added. + */ + async addReaction(channelId: string, contentId: string, emoteId: number): Promise { + await this.client.reactions.create(channelId, contentId, emoteId); + } + + /** + * Deletes either a whole reaction emote from a message or a specific user's if a userId is provided. + * + * @param channelId The ID of the channel containing the message. + * @param contentId The ID of the message to delete the reaction from. + * @param emoteId The ID of the emote to delete as a reaction. + * @returns A promise that resolves to nothing when the reaction is deleted. + */ + async deleteReaction(channelId: string, contentId: string, emoteId: number, userId?: string): Promise { + await this.client.reactions.delete(channelId, contentId, emoteId, userId); + } + + /** + * Updates a message in a channel. + * + * @param channelId The ID of the channel containing the message. + * @param messageId The ID of the message to update. + * @param content The new content of the message. + * @returns A promise that resolves with the updated message. + */ + async update(channelId: string, messageId: string, content: MessageContent): Promise { + const data = await this.client.rest.router.chat.channelMessageUpdate({ + channelId, + messageId, + requestBody: resolveContentToData(content), + }); + + const existingMessage = this.client.messages.cache.get(data.message.id); + if (existingMessage) return existingMessage._update(data.message); + + const newMessage = new Message(this.client, data.message); + this.client.messages.cache.set(newMessage.id, newMessage); + return newMessage; + } + + /** Delete a channel message. */ + async delete(channelId: string, messageId: string): Promise { + await this.client.rest.router.chat.channelMessageDelete({ + channelId, + messageId, + }); + } + + async awaitMessages(channelId: string, options: CollectorOptions): Promise> { + return new MessageCollector(this.client, { + ...options, + filter: (item): MaybePromise => { + if (item.channelId !== channelId) return false; + return options.filter?.(item) ?? true; + }, + }).start(); + } } diff --git a/packages/guilded.js/lib/managers/global/ReactionManager.ts b/packages/guilded.js/lib/managers/global/ReactionManager.ts index 8e2ed5f1..b4c1a1d9 100644 --- a/packages/guilded.js/lib/managers/global/ReactionManager.ts +++ b/packages/guilded.js/lib/managers/global/ReactionManager.ts @@ -7,59 +7,59 @@ import { CacheableStructManager } from "./CacheableStructManager"; * A class representing a global reaction manager that extends the CacheableStructManager class. */ export class GlobalReactionManager extends CacheableStructManager { - get shouldCacheReaction(): boolean { - return this.client.options.cache?.cacheMessageReactions !== false; - } + get shouldCacheReaction(): boolean { + return this.client.options.cache?.cacheMessageReactions !== false; + } - /** - * Adds a reaction emote to a message. - * - * @param channelId The ID of the channel where the message was sent. - * @param messageId The ID of the message. - * @param emoteId The ID of the emote to add. - * @returns A Promise that resolves with no value upon successful completion. - */ - async create(channelId: string, messageId: string, emoteId: number): Promise { - await this.client.rest.router.reactions.channelMessageReactionCreate({ - channelId, - messageId, - emoteId, - }); - } + /** + * Adds a reaction emote to a message. + * + * @param channelId The ID of the channel where the message was sent. + * @param messageId The ID of the message. + * @param emoteId The ID of the emote to add. + * @returns A Promise that resolves with no value upon successful completion. + */ + async create(channelId: string, messageId: string, emoteId: number): Promise { + await this.client.rest.router.reactions.channelMessageReactionCreate({ + channelId, + messageId, + emoteId, + }); + } - /** - * Deletes either a whole reaction emote from a message or a specific user's if a userId is provided. - * - * @param channelId The ID of the channel where the message was sent. - * @param messageId The ID of the message. - * @param emoteId The ID of the emote to delete. - * @returns A Promise that resolves with no value upon successful completion. - */ - async delete(channelId: string, messageId: string, emoteId: number, userId?: string): Promise { - await this.client.rest.router.reactions.channelMessageReactionDelete({ - channelId, - messageId, - emoteId, - userId, - }); - } + /** + * Deletes either a whole reaction emote from a message or a specific user's if a userId is provided. + * + * @param channelId The ID of the channel where the message was sent. + * @param messageId The ID of the message. + * @param emoteId The ID of the emote to delete. + * @returns A Promise that resolves with no value upon successful completion. + */ + async delete(channelId: string, messageId: string, emoteId: number, userId?: string): Promise { + await this.client.rest.router.reactions.channelMessageReactionDelete({ + channelId, + messageId, + emoteId, + userId, + }); + } - /** - * Wait & collect reactions on a message. - * - * @param messageId ID of the message to listen for reactions on - * @param options Configuration for the collector - * @returns A Promise that resolves with a collection of reactions collected, with the ID as the key and the reaction as the value - * @example - * const reactions = await client.reactions.awaitReactions('message-id-here', { max: 4, time: 60_000 }); - */ - awaitReactions(messageId: string, options: CollectorOptions): Promise> { - return new ReactionCollector(this.client, { - ...options, - filter: (item): MaybePromise => { - if (item.messageId !== messageId) return false; - return options.filter?.(item) ?? true; - }, - }).start(); - } + /** + * Wait & collect reactions on a message. + * + * @param messageId ID of the message to listen for reactions on + * @param options Configuration for the collector + * @returns A Promise that resolves with a collection of reactions collected, with the ID as the key and the reaction as the value + * @example + * const reactions = await client.reactions.awaitReactions('message-id-here', { max: 4, time: 60_000 }); + */ + awaitReactions(messageId: string, options: CollectorOptions): Promise> { + return new ReactionCollector(this.client, { + ...options, + filter: (item): MaybePromise => { + if (item.messageId !== messageId) return false; + return options.filter?.(item) ?? true; + }, + }).start(); + } } diff --git a/packages/guilded.js/lib/managers/global/RoleManager.ts b/packages/guilded.js/lib/managers/global/RoleManager.ts index e0fb63a1..095d8487 100644 --- a/packages/guilded.js/lib/managers/global/RoleManager.ts +++ b/packages/guilded.js/lib/managers/global/RoleManager.ts @@ -9,162 +9,169 @@ import { CacheableStructManager } from "./CacheableStructManager"; * A class representing a global role manager. At the moment, we don't cache roles in this structure. */ export class GlobalRoleManager extends CacheableStructManager { - /** - * Create a new role. - * - * @param serverId The ID of the server. - * @param options Role creation options. - * @returns Promise that resolves with the newly created role. - */ - async create(serverId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.roles.roleCreate({ - serverId, - requestBody: options, - }); - const newRole = new Role(this.client, data.role); - this.cache.set(newRole.id, newRole); - return newRole; - } + /** + * Create a new role. + * + * @param serverId The ID of the server. + * @param options Role creation options. + * @returns Promise that resolves with the newly created role. + */ + async create(serverId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.roles.roleCreate({ + serverId, + requestBody: options, + }); + const newRole = new Role(this.client, data.role); + this.cache.set(newRole.id, newRole); + return newRole; + } - /** - * Fetch a role by its ID - * - * @param serverId The ID of the server. - * @param roleId ID of the role to fetch. - * @param force Whether or not to force a fetch from the API. - * @returns Promise that resolves with the fetched role. - */ - async fetch(serverId: string, roleId: number, force?: boolean): Promise { - if (!force) { - const existingRole = this.client.roles.cache.get(roleId); - if (existingRole) return existingRole; - } + /** + * Fetch a role by its ID + * + * @param serverId The ID of the server. + * @param roleId ID of the role to fetch. + * @param force Whether or not to force a fetch from the API. + * @returns Promise that resolves with the fetched role. + */ + async fetch(serverId: string, roleId: number, force?: boolean): Promise { + if (!force) { + const existingRole = this.client.roles.cache.get(roleId); + if (existingRole) return existingRole; + } - const data = await this.client.rest.router.roles.roleRead({ - serverId, - roleId, - }); - const fetchedRole = new Role(this.client, data.role); - this.cache.set(fetchedRole.id, fetchedRole); - return fetchedRole; - } + const data = await this.client.rest.router.roles.roleRead({ + serverId, + roleId, + }); + const fetchedRole = new Role(this.client, data.role); + this.cache.set(fetchedRole.id, fetchedRole); + return fetchedRole; + } - /** - * Fetch all roles in a given server. - * - * @param serverId The ID of the server. - * @returns Promise that resolves with a Collection of fetched roles. - */ - async fetchMany(serverId: string): Promise> { - const data = await this.client.rest.router.roles.roleReadMany({ serverId }); - const roles = new Collection(); + /** + * Fetch all roles in a given server. + * + * @param serverId The ID of the server. + * @returns Promise that resolves with a Collection of fetched roles. + */ + async fetchMany(serverId: string): Promise> { + const data = await this.client.rest.router.roles.roleReadMany({ + serverId, + }); + const roles = new Collection(); - // Insert all fetched roles into cache - for (const role of data.roles) { - const fetchedRole = new Role(this.client, role); - this.cache.set(fetchedRole.id, fetchedRole); - roles.set(fetchedRole.id, fetchedRole); - } + // Insert all fetched roles into cache + for (const role of data.roles) { + const fetchedRole = new Role(this.client, role); + this.cache.set(fetchedRole.id, fetchedRole); + roles.set(fetchedRole.id, fetchedRole); + } - return roles; - } + return roles; + } - /** - * Update a role by ID. - * - * @param serverId The ID of the server. - * @param roleId ID of the role to update. - * @param options Role update options. - * @returns Promise that resolves with the updated role. - */ - async update(serverId: string, roleId: number, options: OptionBody): Promise { - const data = await this.client.rest.router.roles.roleUpdate({ - serverId, - roleId, - requestBody: options, - }); - const existingRole = this.cache.get(roleId); - if (existingRole) return existingRole._update(data.role); + /** + * Update a role by ID. + * + * @param serverId The ID of the server. + * @param roleId ID of the role to update. + * @param options Role update options. + * @returns Promise that resolves with the updated role. + */ + async update(serverId: string, roleId: number, options: OptionBody): Promise { + const data = await this.client.rest.router.roles.roleUpdate({ + serverId, + roleId, + requestBody: options, + }); + const existingRole = this.cache.get(roleId); + if (existingRole) return existingRole._update(data.role); - const newRole = new Role(this.client, data.role); - this.cache.set(newRole.id, newRole); - return newRole; - } + const newRole = new Role(this.client, data.role); + this.cache.set(newRole.id, newRole); + return newRole; + } - /** - * Delete a role by ID. - * - * @param serverId ID of the server to delete the role. - * @param roleId ID of the role to delete. - * @returns Promise that resolves with the cached deleted role, or null if the role isn't present in the cache. - */ - async delete(serverId: string, roleId: number): Promise { - await this.client.rest.router.roles.roleDelete({ serverId, roleId }); - const cachedRole = this.cache.get(roleId); - return cachedRole ?? null; - } + /** + * Delete a role by ID. + * + * @param serverId ID of the server to delete the role. + * @param roleId ID of the role to delete. + * @returns Promise that resolves with the cached deleted role, or null if the role isn't present in the cache. + */ + async delete(serverId: string, roleId: number): Promise { + await this.client.rest.router.roles.roleDelete({ + serverId, + roleId, + }); + const cachedRole = this.cache.get(roleId); + return cachedRole ?? null; + } - /** - * Updates the permissions of a role. - * - * @param serverId The ID of the server. - * @param roleId The ID of the role. - * @param options Role permission update options. - * @returns A Promise that resolves with no value upon successful completion. - */ - async updatePermissions(serverId: string, roleId: number, options: OptionBody): Promise { - await this.client.rest.router.roles.rolePermissionUpdate({ - serverId, - roleId, - requestBody: options, - }); - } + /** + * Updates the permissions of a role. + * + * @param serverId The ID of the server. + * @param roleId The ID of the role. + * @param options Role permission update options. + * @returns A Promise that resolves with no value upon successful completion. + */ + async updatePermissions(serverId: string, roleId: number, options: OptionBody): Promise { + await this.client.rest.router.roles.rolePermissionUpdate({ + serverId, + roleId, + requestBody: options, + }); + } - /** - * Awards XP to a role. - * - * @param serverId The ID of the server. - * @param roleId The ID of the role. - * @param amount The amount of XP to award. - * @returns A Promise that resolves with the total XP awarded to the role. - */ - async giveXP(serverId: string, roleId: number, amount: number): Promise { - await this.client.rest.router.serverXp.serverXpForRoleCreate({ - serverId, - roleId, - requestBody: { amount }, - }); - } + /** + * Awards XP to a role. + * + * @param serverId The ID of the server. + * @param roleId The ID of the role. + * @param amount The amount of XP to award. + * @returns A Promise that resolves with the total XP awarded to the role. + */ + async giveXP(serverId: string, roleId: number, amount: number): Promise { + await this.client.rest.router.serverXp.serverXpForRoleCreate({ + serverId, + roleId, + requestBody: { + amount, + }, + }); + } - /** - * Assigns a role to a member. - * - * @param serverId The ID of the server. - * @param userId The ID of the member. - * @param roleId The ID of the role. - * @returns A Promise that resolves with no value upon successful completion. - */ - async addRoleToMember(serverId: string, userId: string, roleId: number): Promise { - await this.client.rest.router.roleMembership.roleMembershipCreate({ - serverId, - userId, - roleId, - }); - } + /** + * Assigns a role to a member. + * + * @param serverId The ID of the server. + * @param userId The ID of the member. + * @param roleId The ID of the role. + * @returns A Promise that resolves with no value upon successful completion. + */ + async addRoleToMember(serverId: string, userId: string, roleId: number): Promise { + await this.client.rest.router.roleMembership.roleMembershipCreate({ + serverId, + userId, + roleId, + }); + } - /** - * Removes a role from a member. - * - * @param serverId The ID of the server. - * @param userId The ID of the member. - * @param roleId The ID of the role. - * @returns A Promise that resolves with no value upon successful completion. - */ - async removeRoleFromMember(serverId: string, userId: string, roleId: number): Promise { - await this.client.rest.router.roleMembership.roleMembershipDelete({ - serverId, - userId, - roleId, - }); - } + /** + * Removes a role from a member. + * + * @param serverId The ID of the server. + * @param userId The ID of the member. + * @param roleId The ID of the role. + * @returns A Promise that resolves with no value upon successful completion. + */ + async removeRoleFromMember(serverId: string, userId: string, roleId: number): Promise { + await this.client.rest.router.roleMembership.roleMembershipDelete({ + serverId, + userId, + roleId, + }); + } } diff --git a/packages/guilded.js/lib/managers/global/ServerManager.ts b/packages/guilded.js/lib/managers/global/ServerManager.ts index f0608eec..d66b32ae 100644 --- a/packages/guilded.js/lib/managers/global/ServerManager.ts +++ b/packages/guilded.js/lib/managers/global/ServerManager.ts @@ -7,30 +7,32 @@ import { CacheableStructManager } from "./CacheableStructManager"; * @extends CacheableStructManager */ export class GlobalServerManager extends CacheableStructManager { - /** - * Determines whether or not servers should be cached. - */ - get shouldCacheServer(): boolean { - return this.client.options?.cache?.cacheServers !== false; - } + /** + * Determines whether or not servers should be cached. + */ + get shouldCacheServer(): boolean { + return this.client.options?.cache?.cacheServers !== false; + } - /** - * Fetches a server. - * - * @param serverId The ID of the server to fetch. - * @param force Whether or not to force a fetch instead of using the cache. - * @returns A Promise that resolves with the fetched server. - * @example client.servers.fetch(message.serverId) - */ - async fetch(serverId: string, force?: boolean): Promise { - if (!force) { - const existingServer = this.client.servers.cache.get(serverId); - if (existingServer) return existingServer; - } + /** + * Fetches a server. + * + * @param serverId The ID of the server to fetch. + * @param force Whether or not to force a fetch instead of using the cache. + * @returns A Promise that resolves with the fetched server. + * @example client.servers.fetch(message.serverId) + */ + async fetch(serverId: string, force?: boolean): Promise { + if (!force) { + const existingServer = this.client.servers.cache.get(serverId); + if (existingServer) return existingServer; + } - const data = await this.client.rest.router.servers.serverRead({ serverId }); - const newServer = new Server(this.client, data.server); - if (this.shouldCacheServer) this.cache.set(newServer.id, newServer); - return newServer; - } + const data = await this.client.rest.router.servers.serverRead({ + serverId, + }); + const newServer = new Server(this.client, data.server); + if (this.shouldCacheServer) this.cache.set(newServer.id, newServer); + return newServer; + } } diff --git a/packages/guilded.js/lib/managers/global/SubscriptionManager.ts b/packages/guilded.js/lib/managers/global/SubscriptionManager.ts index 08acdb66..d4797539 100644 --- a/packages/guilded.js/lib/managers/global/SubscriptionManager.ts +++ b/packages/guilded.js/lib/managers/global/SubscriptionManager.ts @@ -6,33 +6,36 @@ import { GlobalManager } from "./GlobalManager"; * A class representing a global subscription tier manager. */ export class GlobalSubscriptionManager extends GlobalManager { - /** - * Fetches a subscription tier from a server. - * - * @param serverId The ID of the server to fetch the subscription tier from. - * @param tier The type of subscription tier to fetch. - * @returns A Promise that resolves with the fetched subscription tier. - */ - async fetch(serverId: string, tier: ServerSubscriptionTierType): Promise { - const data = await this.client.rest.router.serverSubscriptions.serverSubscriptionTierRead({ serverId, serverSubscriptionTierType: tier }); - return new ServerSubscriptionTier(this.client, data.serverSubscriptionTier); - } + /** + * Fetches a subscription tier from a server. + * + * @param serverId The ID of the server to fetch the subscription tier from. + * @param tier The type of subscription tier to fetch. + * @returns A Promise that resolves with the fetched subscription tier. + */ + async fetch(serverId: string, tier: ServerSubscriptionTierType): Promise { + const data = await this.client.rest.router.serverSubscriptions.serverSubscriptionTierRead({ + serverId, + serverSubscriptionTierType: tier, + }); + return new ServerSubscriptionTier(this.client, data.serverSubscriptionTier); + } - /** - * Fetches all the subscription tiers from a server. - * - * @param serverId The ID of the server to fetch subscription tiers from. - * @returns A Promise that resolves with an array of subscription tiers. - */ - async fetchMany(serverId: string): Promise { - const data = await this.client.rest.router.serverSubscriptions.serverSubscriptionTierReadMany({ - serverId, - }); - const serverSubscriptionTiers: ServerSubscriptionTier[] = []; - for (const tier of data.serverSubscriptionTiers) { - serverSubscriptionTiers.push(new ServerSubscriptionTier(this.client, tier)); - } + /** + * Fetches all the subscription tiers from a server. + * + * @param serverId The ID of the server to fetch subscription tiers from. + * @returns A Promise that resolves with an array of subscription tiers. + */ + async fetchMany(serverId: string): Promise { + const data = await this.client.rest.router.serverSubscriptions.serverSubscriptionTierReadMany({ + serverId, + }); + const serverSubscriptionTiers: ServerSubscriptionTier[] = []; + for (const tier of data.serverSubscriptionTiers) { + serverSubscriptionTiers.push(new ServerSubscriptionTier(this.client, tier)); + } - return serverSubscriptionTiers; - } + return serverSubscriptionTiers; + } } diff --git a/packages/guilded.js/lib/managers/global/UserManager.ts b/packages/guilded.js/lib/managers/global/UserManager.ts index 96fe6c90..a6b5fc9f 100644 --- a/packages/guilded.js/lib/managers/global/UserManager.ts +++ b/packages/guilded.js/lib/managers/global/UserManager.ts @@ -10,44 +10,44 @@ import { CacheableStructManager } from "./CacheableStructManager"; * @extends CacheableStructManager */ export class GlobalUserManager extends CacheableStructManager { - /** - * Fetches client user. - * - * @param force Whether to force a fetch from the API. - * @returns A Promise that resolves with the fetched user. - */ - async fetchClient(force?: boolean): Promise { - if (!force) { - const existingUser = this.client.users.cache.get(this.client.user!.id); - if (existingUser) return existingUser; - } + /** + * Fetches client user. + * + * @param force Whether to force a fetch from the API. + * @returns A Promise that resolves with the fetched user. + */ + async fetchClient(force?: boolean): Promise { + if (!force) { + const existingUser = this.client.users.cache.get(this.client.user?.id!); + if (existingUser) return existingUser; + } - const data = await this.client.rest.router.users.userRead({ - userId: "@me", - }); - return new User(this.client, data.user); - } + const data = await this.client.rest.router.users.userRead({ + userId: "@me", + }); + return new User(this.client, data.user); + } - /** - * Fetches a user's servers (atm, only the logged in client is supported) - * - * @param userId The ID of the user to fetch servers for. - * @returns A promise that resolves to a Collection with the returned servers. - */ - async fetchServers(userId: string): Promise> { - if (userId !== this.client.user!.id) throw new Error("Only the logged in client is supported at this time."); + /** + * Fetches a user's servers (atm, only the logged in client is supported) + * + * @param userId The ID of the user to fetch servers for. + * @returns A promise that resolves to a Collection with the returned servers. + */ + async fetchServers(userId: string): Promise> { + if (userId !== this.client.user?.id) throw new Error("Only the logged in client is supported at this time."); - const data = await this.client.rest.router.users.userServerReadMany({ - userId, - }); - const servers = new Collection(); + const data = await this.client.rest.router.users.userServerReadMany({ + userId, + }); + const servers = new Collection(); - for (const server of data.servers) { - const createdServer = new Server(this.client, server); - servers.set(server.id, createdServer); - this.client.servers.cache.set(server.id, createdServer); - } + for (const server of data.servers) { + const createdServer = new Server(this.client, server); + servers.set(server.id, createdServer); + this.client.servers.cache.set(server.id, createdServer); + } - return servers; - } + return servers; + } } diff --git a/packages/guilded.js/lib/managers/global/WebhookManager.ts b/packages/guilded.js/lib/managers/global/WebhookManager.ts index f1d23e5e..bcae8cce 100644 --- a/packages/guilded.js/lib/managers/global/WebhookManager.ts +++ b/packages/guilded.js/lib/managers/global/WebhookManager.ts @@ -10,108 +10,108 @@ import { CacheableStructManager } from "./CacheableStructManager"; * @extends CacheableStructManager */ export class GlobalWebhookManager extends CacheableStructManager { - get shouldCacheWebhook(): boolean { - return this.client.options.cache?.cacheWebhooks !== false; - } + get shouldCacheWebhook(): boolean { + return this.client.options.cache?.cacheWebhooks !== false; + } - /** - * Create a webhook - * - * @param serverId The ID of the server to create the webhook for - * @param options The options for creating the webhook - * @returns A Promise that resolves to the created webhook - */ - async create(serverId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.webhook.webhookCreate({ - serverId, - requestBody: options, - }); - const existingWebhook = this.client.webhooks.cache.get(data.webhook.id); - if (existingWebhook) return existingWebhook; - const newWebhook = new Webhook(this.client, data.webhook); - if (this.shouldCacheWebhook) this.cache.set(newWebhook.id, newWebhook); - return newWebhook; - } + /** + * Create a webhook + * + * @param serverId The ID of the server to create the webhook for + * @param options The options for creating the webhook + * @returns A Promise that resolves to the created webhook + */ + async create(serverId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.webhook.webhookCreate({ + serverId, + requestBody: options, + }); + const existingWebhook = this.client.webhooks.cache.get(data.webhook.id); + if (existingWebhook) return existingWebhook; + const newWebhook = new Webhook(this.client, data.webhook); + if (this.shouldCacheWebhook) this.cache.set(newWebhook.id, newWebhook); + return newWebhook; + } - /** - * Get a server's webhooks - * - * @param serverId The ID of the server to get webhooks for - * @param channelId The ID of the channel to get webhooks for - * @returns A Promise that resolves to a Collection of Webhooks - */ - async fetchMany(serverId: string, channelId: string): Promise> { - const data = await this.client.rest.router.webhook.webhookReadMany({ - serverId, - channelId, - }); - const webhooks = new Collection(); - for (const webhook of data.webhooks) { - const newWebhook = new Webhook(this.client, webhook); - webhooks.set(newWebhook.id, newWebhook); - if (this.shouldCacheWebhook) this.cache.set(newWebhook.id, newWebhook); - } + /** + * Get a server's webhooks + * + * @param serverId The ID of the server to get webhooks for + * @param channelId The ID of the channel to get webhooks for + * @returns A Promise that resolves to a Collection of Webhooks + */ + async fetchMany(serverId: string, channelId: string): Promise> { + const data = await this.client.rest.router.webhook.webhookReadMany({ + serverId, + channelId, + }); + const webhooks = new Collection(); + for (const webhook of data.webhooks) { + const newWebhook = new Webhook(this.client, webhook); + webhooks.set(newWebhook.id, newWebhook); + if (this.shouldCacheWebhook) this.cache.set(newWebhook.id, newWebhook); + } - return webhooks; - } + return webhooks; + } - /** - * Get a webhook - * - * @param serverId The ID of the server the webhook is in - * @param webhookId The ID of the webhook - * @param force Whether to skip the cache check and request the API - * @returns A Promise that resolves to the fetched webhook - */ - async fetch(serverId: string, webhookId: string, force?: boolean): Promise { - if (!force) { - const existingWebhook = this.client.webhooks.cache.get(webhookId); - if (existingWebhook) return existingWebhook; - } + /** + * Get a webhook + * + * @param serverId The ID of the server the webhook is in + * @param webhookId The ID of the webhook + * @param force Whether to skip the cache check and request the API + * @returns A Promise that resolves to the fetched webhook + */ + async fetch(serverId: string, webhookId: string, force?: boolean): Promise { + if (!force) { + const existingWebhook = this.client.webhooks.cache.get(webhookId); + if (existingWebhook) return existingWebhook; + } - const data = await this.client.rest.router.webhook.webhookRead({ - serverId, - webhookId, - }); - const newWebhook = new Webhook(this.client, data.webhook); - if (this.shouldCacheWebhook) this.cache.set(newWebhook.id, newWebhook); - return newWebhook; - } + const data = await this.client.rest.router.webhook.webhookRead({ + serverId, + webhookId, + }); + const newWebhook = new Webhook(this.client, data.webhook); + if (this.shouldCacheWebhook) this.cache.set(newWebhook.id, newWebhook); + return newWebhook; + } - /** - * Update a webhook - * - * @param serverId The ID of the server the webhook is in - * @param webhookId The ID of the webhook to update - * @param options The options for updating the webhook - * @returns A Promise that resolves to the updated Webhook - */ - async update(serverId: string, webhookId: string, options: OptionBody): Promise { - const data = await this.client.rest.router.webhook.webhookUpdate({ - serverId, - webhookId, - requestBody: options, - }); - const existingWebhook = this.cache.get(data.webhook.id); - if (existingWebhook) { - existingWebhook._update(data.webhook); - return existingWebhook; - } + /** + * Update a webhook + * + * @param serverId The ID of the server the webhook is in + * @param webhookId The ID of the webhook to update + * @param options The options for updating the webhook + * @returns A Promise that resolves to the updated Webhook + */ + async update(serverId: string, webhookId: string, options: OptionBody): Promise { + const data = await this.client.rest.router.webhook.webhookUpdate({ + serverId, + webhookId, + requestBody: options, + }); + const existingWebhook = this.cache.get(data.webhook.id); + if (existingWebhook) { + existingWebhook._update(data.webhook); + return existingWebhook; + } - return new Webhook(this.client, data.webhook); - } + return new Webhook(this.client, data.webhook); + } - /** - * Delete a webhook - * - * @param serverId The ID of the server the webhook is in - * @param webhookId The ID of the webhook to delete - * @returns A Promise that resolves with no value upon successful deletion - */ - async delete(serverId: string, webhookId: string): Promise { - await this.client.rest.router.webhook.webhookDelete({ - serverId, - webhookId, - }); - } + /** + * Delete a webhook + * + * @param serverId The ID of the server the webhook is in + * @param webhookId The ID of the webhook to delete + * @returns A Promise that resolves with no value upon successful deletion + */ + async delete(serverId: string, webhookId: string): Promise { + await this.client.rest.router.webhook.webhookDelete({ + serverId, + webhookId, + }); + } } diff --git a/packages/guilded.js/lib/structures/Base.ts b/packages/guilded.js/lib/structures/Base.ts index 64e71b4c..47e663fc 100644 --- a/packages/guilded.js/lib/structures/Base.ts +++ b/packages/guilded.js/lib/structures/Base.ts @@ -5,22 +5,27 @@ import type { Client } from "./Client"; * All structures that have an ID will extend this class. */ export class Base { - /** Identifier of this structrure */ - public id: R; + /** Identifier of this structrure */ + public id: R; - /** Bare data of this structure */ - public raw: T; + /** Bare data of this structure */ + public raw: T; - constructor(public readonly client: Client, data: T & { id: R }) { - this.id = data.id; - this.raw = data; - } + constructor( + public readonly client: Client, + data: T & { + id: R; + }, + ) { + this.id = data.id; + this.raw = data; + } - /** - * Taken from https://github.com/discordjs/discord.js/blob/8e8d9b490a71de6cabe6f16375d7549a7c5c3737/src/structures/Base.js#L20 - * Licensed under the Apache License 2.0 - */ - public _clone(): this { - return Object.assign(Object.create(this), this); - } + /** + * Taken from https://github.com/discordjs/discord.js/blob/8e8d9b490a71de6cabe6f16375d7549a7c5c3737/src/structures/Base.js#L20 + * Licensed under the Apache License 2.0 + */ + public _clone(): this { + return Object.assign(Object.create(this), this); + } } diff --git a/packages/guilded.js/lib/structures/CalendarEvent.ts b/packages/guilded.js/lib/structures/CalendarEvent.ts index c15b8c60..6a41e7d2 100644 --- a/packages/guilded.js/lib/structures/CalendarEvent.ts +++ b/packages/guilded.js/lib/structures/CalendarEvent.ts @@ -1,5 +1,5 @@ import { Collection } from "@discordjs/collection"; -import type { CalendarEventPayload, MentionsPayload, CalendarEventRsvpPayload } from "@guildedjs/api"; +import type { CalendarEventPayload, CalendarEventRsvpPayload, MentionsPayload } from "@guildedjs/api"; import { parseToStamp } from "../util"; import { Base } from "./Base"; import type { Client } from "./Client"; @@ -9,233 +9,233 @@ import type { User } from "./User"; * Represents a calendar event on Guilded */ export class CalendarEvent extends Base { - /** The ID of the calendar event (min 1) */ - readonly id: number; + /** The ID of the calendar event (min 1) */ + readonly id: number; - /** The ID of the server */ - readonly serverId: string; + /** The ID of the server */ + readonly serverId: string; - /** The ID of the channel */ - readonly channelId: string; - - /** The name of the event (min length 1; max length 60) */ - name: string; - - /** The description of the event (min length 1; max length 8000) */ - description?: string | null; - - /** The location of the event (min length 1; max length 8000) */ - location?: string | null; - - /** A URL to associate with the event */ - url?: string | null; - - /** The color of the event when viewing in the calendar (min 0; max 16777215) */ - color?: number | null; - - /** The ISO 8601 timestamp that the event starts at */ - startsAt: string; - - /** The duration of the event in minutes (min 1) */ - duration?: number | null; - - /** Whether this event is private or not */ - isPrivate?: boolean; - - /** The mentions in this calendar event */ - mentions?: MentionsPayload; - - /** The cancellations for this event */ - cancellation?: CalendarEventPayload["cancellation"]; - - /** The number of rsvps to allow before waitlisting rsvps (min 1) */ - rsvpLimit?: number | null; - - /** A collection of cached rsvps for this calendar event */ - rsvps: Collection; - - /** The role IDs to restrict the event to (min items 1; must have unique items true) */ - roleIds?: number[] | null; - - /** The ID of the calendar event series. Only shows if the event is repeating */ - seriesId?: string | null; - - /** Whether this event is repeating */ - repeats?: boolean | null; - - /** Whether this event lasts all day */ - isAllDay?: boolean | null; - - /** When rsvpLimit is set, users from the waitlist will be added as space becomes available in the event */ - autofillWaitlist?: boolean | null; - - /** The ISO 8601 timestamp that the event was created at */ - readonly _createdAt: number; - - /** The ID of the user who created this event */ - readonly createdBy: string; - - constructor(client: Client, data: CalendarEventPayload) { - super(client, data); - - this.id = data.id; - this.serverId = data.serverId; - this.channelId = data.channelId; - this.name = data.name; - this.description = data.description ?? null; - this.location = data.location ?? null; - this.url = data.url ?? null; - this.color = data.color ?? null; - this.startsAt = data.startsAt; - this.duration = data.duration ?? null; - this.isPrivate = data.isPrivate ?? false; - this._createdAt = parseToStamp(data.createdAt)!; - this.createdBy = data.createdBy; - this.rsvpLimit = data.rsvpLimit ?? null; - this.rsvps = new Collection(); - this.roleIds = data.roleIds ?? null; - this.seriesId = data.seriesId ?? null; - this.repeats = data.repeats ?? null; - this.isAllDay = data.isAllDay ?? null; - this.autofillWaitlist = data.autofillWaitlist ?? null; - - this._update(data); - } - - /** - * Get the author of this calendar event - * - * @returns The author of this calendar event or null if the author is not cached - */ - get author(): User | null { - return this.client.users.cache.get(this.createdBy) ?? null; - } - - /** - * Get the date this calendar event was created - * - * @returns The date this calendar event was created - */ - get createdAt(): Date { - return new Date(this._createdAt); - } - - _update(data: Partial): this { - if ("name" in data && typeof data.name !== "undefined") { - this.name = data.name; - } - - if ("description" in data && typeof data.description !== "undefined") { - this.description = data.description; - } - - if ("url" in data && typeof data.url !== "undefined") { - this.url = data.url; - } - - if ("color" in data && typeof data.color !== "undefined") { - this.color = data.color; - } - - if ("startsAt" in data && typeof data.startsAt !== "undefined") { - this.startsAt = data.startsAt; - } - - if ("duration" in data && typeof data.duration !== "undefined") { - this.duration = data.duration; - } - - if ("isPrivate" in data && typeof data.isPrivate !== "undefined") { - this.isPrivate = data.isPrivate; - } - - if ("mentions" in data && typeof data.mentions !== "undefined") { - this.mentions = data.mentions; - } - - if ("cancellation" in data && typeof data.cancellation !== "undefined") { - this.cancellation = data.cancellation; - } - - if ("rsvpLimit" in data && typeof data.rsvpLimit !== "undefined") { - this.rsvpLimit = data.rsvpLimit ?? null; - } - - return this; - } + /** The ID of the channel */ + readonly channelId: string; + + /** The name of the event (min length 1; max length 60) */ + name: string; + + /** The description of the event (min length 1; max length 8000) */ + description?: string | null; + + /** The location of the event (min length 1; max length 8000) */ + location?: string | null; + + /** A URL to associate with the event */ + url?: string | null; + + /** The color of the event when viewing in the calendar (min 0; max 16777215) */ + color?: number | null; + + /** The ISO 8601 timestamp that the event starts at */ + startsAt: string; + + /** The duration of the event in minutes (min 1) */ + duration?: number | null; + + /** Whether this event is private or not */ + isPrivate?: boolean; + + /** The mentions in this calendar event */ + mentions?: MentionsPayload; + + /** The cancellations for this event */ + cancellation?: CalendarEventPayload["cancellation"]; + + /** The number of rsvps to allow before waitlisting rsvps (min 1) */ + rsvpLimit?: number | null; + + /** A collection of cached rsvps for this calendar event */ + rsvps: Collection; + + /** The role IDs to restrict the event to (min items 1; must have unique items true) */ + roleIds?: number[] | null; + + /** The ID of the calendar event series. Only shows if the event is repeating */ + seriesId?: string | null; + + /** Whether this event is repeating */ + repeats?: boolean | null; + + /** Whether this event lasts all day */ + isAllDay?: boolean | null; + + /** When rsvpLimit is set, users from the waitlist will be added as space becomes available in the event */ + autofillWaitlist?: boolean | null; + + /** The ISO 8601 timestamp that the event was created at */ + readonly _createdAt: number; + + /** The ID of the user who created this event */ + readonly createdBy: string; + + constructor(client: Client, data: CalendarEventPayload) { + super(client, data); + + this.id = data.id; + this.serverId = data.serverId; + this.channelId = data.channelId; + this.name = data.name; + this.description = data.description ?? null; + this.location = data.location ?? null; + this.url = data.url ?? null; + this.color = data.color ?? null; + this.startsAt = data.startsAt; + this.duration = data.duration ?? null; + this.isPrivate = data.isPrivate ?? false; + this._createdAt = parseToStamp(data.createdAt)!; + this.createdBy = data.createdBy; + this.rsvpLimit = data.rsvpLimit ?? null; + this.rsvps = new Collection(); + this.roleIds = data.roleIds ?? null; + this.seriesId = data.seriesId ?? null; + this.repeats = data.repeats ?? null; + this.isAllDay = data.isAllDay ?? null; + this.autofillWaitlist = data.autofillWaitlist ?? null; + + this._update(data); + } + + /** + * Get the author of this calendar event + * + * @returns The author of this calendar event or null if the author is not cached + */ + get author(): User | null { + return this.client.users.cache.get(this.createdBy) ?? null; + } + + /** + * Get the date this calendar event was created + * + * @returns The date this calendar event was created + */ + get createdAt(): Date { + return new Date(this._createdAt); + } + + _update(data: Partial): this { + if ("name" in data && typeof data.name !== "undefined") { + this.name = data.name; + } + + if ("description" in data && typeof data.description !== "undefined") { + this.description = data.description; + } + + if ("url" in data && typeof data.url !== "undefined") { + this.url = data.url; + } + + if ("color" in data && typeof data.color !== "undefined") { + this.color = data.color; + } + + if ("startsAt" in data && typeof data.startsAt !== "undefined") { + this.startsAt = data.startsAt; + } + + if ("duration" in data && typeof data.duration !== "undefined") { + this.duration = data.duration; + } + + if ("isPrivate" in data && typeof data.isPrivate !== "undefined") { + this.isPrivate = data.isPrivate; + } + + if ("mentions" in data && typeof data.mentions !== "undefined") { + this.mentions = data.mentions; + } + + if ("cancellation" in data && typeof data.cancellation !== "undefined") { + this.cancellation = data.cancellation; + } + + if ("rsvpLimit" in data && typeof data.rsvpLimit !== "undefined") { + this.rsvpLimit = data.rsvpLimit ?? null; + } + + return this; + } } /** * Represents a calendar event RSVP */ export class CalendarEventRsvp extends Base { - /** The ID of the calendar event (min 1) */ - readonly calendarEventId: number; + /** The ID of the calendar event (min 1) */ + readonly calendarEventId: number; - /** The ID of the channel */ - readonly channelId: string; + /** The ID of the channel */ + readonly channelId: string; - /** The ID of the server */ - readonly serverId: string; + /** The ID of the server */ + readonly serverId: string; - /** The ID of the user */ - readonly userId: string; + /** The ID of the user */ + readonly userId: string; - /** The status of the rsvp ("going", "maybe", "declined", "invited", "waitlisted", or "not responded") */ - status: string; + /** The status of the rsvp ("going", "maybe", "declined", "invited", "waitlisted", or "not responded") */ + status: string; - /** The ID of the user who created this rsvp */ - readonly createdBy: string; + /** The ID of the user who created this rsvp */ + readonly createdBy: string; - /** The ISO 8601 timestamp that the rsvp was created at */ - readonly _createdAt: number; + /** The ISO 8601 timestamp that the rsvp was created at */ + readonly _createdAt: number; - /** The ID of the user who updated this rsvp */ - updatedBy?: string | null; + /** The ID of the user who updated this rsvp */ + updatedBy?: string | null; - /** The ISO 8601 timestamp that the rsvp was updated at, if relevant */ - updatedAt?: string | null; + /** The ISO 8601 timestamp that the rsvp was updated at, if relevant */ + updatedAt?: string | null; - constructor(client: Client, data: CalendarEventRsvpPayload) { - super(client, { - ...data, - id: data.calendarEventId.toString() + "-" + data.userId, - }); + constructor(client: Client, data: CalendarEventRsvpPayload) { + super(client, { + ...data, + id: `${data.calendarEventId.toString()}-${data.userId}`, + }); - this.calendarEventId = data.calendarEventId; - this.channelId = data.channelId; - this.serverId = data.serverId; - this.userId = data.userId; - this.status = data.status; - this.createdBy = data.createdBy; - this._createdAt = parseToStamp(data.createdAt)!; - this.updatedBy = null; - this.updatedAt = null; + this.calendarEventId = data.calendarEventId; + this.channelId = data.channelId; + this.serverId = data.serverId; + this.userId = data.userId; + this.status = data.status; + this.createdBy = data.createdBy; + this._createdAt = parseToStamp(data.createdAt)!; + this.updatedBy = null; + this.updatedAt = null; - this._update(data); - } + this._update(data); + } - get author(): User | null { - return this.client.users.cache.get(this.createdBy) ?? null; - } + get author(): User | null { + return this.client.users.cache.get(this.createdBy) ?? null; + } - get createdAt(): Date { - return new Date(this._createdAt); - } + get createdAt(): Date { + return new Date(this._createdAt); + } - _update(data: Partial): this { - if ("updatedAt" in data && typeof data.updatedAt !== "undefined") { - this.updatedAt = data.updatedAt ?? null; - } + _update(data: Partial): this { + if ("updatedAt" in data && typeof data.updatedAt !== "undefined") { + this.updatedAt = data.updatedAt ?? null; + } - if ("updatedBy" in data && typeof data.updatedBy !== "undefined") { - this.updatedBy = data.updatedBy ?? null; - } + if ("updatedBy" in data && typeof data.updatedBy !== "undefined") { + this.updatedBy = data.updatedBy ?? null; + } - if ("status" in data && typeof data.status !== "undefined") { - this.status = data.status; - } + if ("status" in data && typeof data.status !== "undefined") { + this.status = data.status; + } - return this; - } + return this; + } } diff --git a/packages/guilded.js/lib/structures/Category.ts b/packages/guilded.js/lib/structures/Category.ts index 6db04c4a..4cb7319a 100644 --- a/packages/guilded.js/lib/structures/Category.ts +++ b/packages/guilded.js/lib/structures/Category.ts @@ -5,71 +5,71 @@ import { Base } from "./Base"; import type { Client } from "./Client"; export class Category extends Base { - /** The ID of the server this category is in. */ - serverId: string; + /** The ID of the server this category is in. */ + serverId: string; - /** The name of this category. */ - name!: string; + /** The name of this category. */ + name!: string; - /** The timestamp of when this category was created. */ - _createdAt: number; + /** The timestamp of when this category was created. */ + _createdAt: number; - /** The ID of the group this category is in. */ - groupId: string; + /** The ID of the group this category is in. */ + groupId: string; - /** The timestamp of when this category was last updated. */ - _updatedAt!: number | null; + /** The timestamp of when this category was last updated. */ + _updatedAt!: number | null; - constructor(client: Client, data: CategoryPayload) { - super(client, data); - this.serverId = data.serverId; - this._createdAt = parseToStamp(data.createdAt)!; - this.groupId = data.groupId; + constructor(client: Client, data: CategoryPayload) { + super(client, data); + this.serverId = data.serverId; + this._createdAt = parseToStamp(data.createdAt)!; + this.groupId = data.groupId; - this._update(data); - } + this._update(data); + } - _update(data: CategoryPayload): this { - if (typeof data.name !== "undefined") this.name = data.name; - if (typeof data.updatedAt !== "undefined") this._updatedAt = parseToStamp(data.updatedAt); + _update(data: CategoryPayload): this { + if (typeof data.name !== "undefined") this.name = data.name; + if (typeof data.updatedAt !== "undefined") this._updatedAt = parseToStamp(data.updatedAt); - return this; - } + return this; + } - /** - * Gets the creation date of this category. - * - * @returns The creation date of this category. - */ - get createdAt(): Date { - return new Date(this._createdAt); - } + /** + * Gets the creation date of this category. + * + * @returns The creation date of this category. + */ + get createdAt(): Date { + return new Date(this._createdAt); + } - /** - * Gets the last time this category was updated. - * - * @returns The last time this category was updated. - */ - get updatedAt(): Date | null { - return this._updatedAt ? new Date(this._updatedAt) : null; - } + /** + * Gets the last time this category was updated. + * + * @returns The last time this category was updated. + */ + get updatedAt(): Date | null { + return this._updatedAt ? new Date(this._updatedAt) : null; + } - /** - * Updates this webhook with new options - * - * @param options The new options for this webhook - * @returns A promise that resolves with the updated webhook - */ - update(options: Parameters[2]): Promise { - return this.client.categories.update(this.serverId, this.id, options); - } + /** + * Updates this webhook with new options + * + * @param options The new options for this webhook + * @returns A promise that resolves with the updated webhook + */ + update(options: Parameters[2]): Promise { + return this.client.categories.update(this.serverId, this.id, options); + } - /** - * Delete this category. - * - * @returns A Promise that resolves with the updated category. - */ - async delete(): Promise { - return this.client.categories.delete(this.serverId, this.id); - } + /** + * Delete this category. + * + * @returns A Promise that resolves with the updated category. + */ + async delete(): Promise { + return this.client.categories.delete(this.serverId, this.id); + } } diff --git a/packages/guilded.js/lib/structures/Client.ts b/packages/guilded.js/lib/structures/Client.ts index 2f8dd104..4507a18f 100644 --- a/packages/guilded.js/lib/structures/Client.ts +++ b/packages/guilded.js/lib/structures/Client.ts @@ -31,387 +31,400 @@ import { ClientUser } from "./User"; * @template ClientEvents The custom events for the client. */ export class Client extends (EventEmitter as unknown as new () => TypedEmitter) { - /** - * The time in milliseconds since the Client connected. - */ - readyTimestamp: number | null = null; - - /** - * The manager for the bot to make requests to the REST api. - */ - rest = new RestManager({ - ...this.options.rest, - token: this.options.token, - }); - - /** - * The websocket connection. - */ - ws = new WebSocketManager({ token: this.options.token }); - - /** - * The gateway events will be processed by this manager. - */ - gatewayHandler = new ClientGatewayHandler(this); - - /** - * A manager for channels, used to manage and interact with channels. - */ - channels = new GlobalChannelManager(this); - - /** - * A manager for docs, used to manage and interact with docs. - */ - docs = new GlobalDocManager(this); - - /** - * A manager for forum topics, used to manage and interact with forum topics. - */ - topics = new GlobalForumTopicManager(this); - - /** - * A manager for groups, used to manage and interact with groups. - */ - groups = new GlobalGroupManager(this); - - /** - * A manager for list items, used to manage and interact with list items. - */ - lists = new GlobalListItemManager(this); - - /** - * A manager for members, used to manage and interact with members. - */ - members = new GlobalMemberManager(this); - - /** - * A manager for messages, used to manage and interact with messages. - */ - messages = new GlobalMessageManager(this); - - /** - * A manager for roles, used to manage and interact with roles. - */ - roles = new GlobalRoleManager(this); - - /** - * A manager for users, used to manage and interact with users. - */ - users = new GlobalUserManager(this); - - /** - * A manager for guild bans, used to manage and interact with bans. - */ - bans = new GlobalGuildBanManager(this); - - /** - * A manager for webhooks, used to manage and interact with webhooks. - */ - webhooks = new GlobalWebhookManager(this); - - /** - * A manager for servers, used to manage and interact with servers. - */ - servers = new GlobalServerManager(this); - - /** - * A manager for reactions, used to manage and interact with reactions. - */ - reactions = new GlobalReactionManager(this); - - /** - * A manager for calendars, used to manage and interact with calendars. - */ - calendars = new GlobalCalendarManager(this); - - /** - * A manager for categories, used to manage and interact with categories. - */ - categories = new GlobalCategoryManager(this); - - /** - * A manager for server subscriptions, used to manage and interact with server subscriptions. - */ - subscriptions = new GlobalSubscriptionManager(this); - - /** - * The user belonging to this bot. - */ - user: ClientUser | null = null; - - /** - * @param options The options for the client. - * @throws {Error} Must provide options in client constructor in the form of an object. - * @throws {Error} No token provided. - */ - constructor(public options: ClientOptions) { - // eslint-disable-next-line constructor-super - super(); - if (typeof options !== "object") throw new Error("Must provide options in client constructor in the form of an object."); - if (typeof options?.token === "undefined") throw new Error("No token provided."); - } - - /** - * The amount of time the bot has been online in milliseconds. - */ - get uptime(): number { - return this.readyTimestamp ? Date.now() - this.readyTimestamp : 0; - } - - /** - * The bot's token. - */ - get token(): string { - return this.options.token; - } - - /** - * Connects the bot to the api. - * - * @param [opts] The options for connecting to the api. - * @param [opts.fresh] Whether this should create a new WebSocketManager instance. - * @example - * let client = new Guilded.Client({ token: process.env.GUILDED_TOKEN }); - * client.on('ready', () => console.log('Logged in!')); - * client.login(); - */ - login(opts?: { fresh?: boolean }): void { - if (opts?.fresh) this.ws = new WebSocketManager({ token: this.options.token }); - this.ws.emitter - .on("error", (reason, err) => this.emit("error", `[WS] ${reason}`, err)) - .on("ready", (user) => { - this.user = new ClientUser(this, user); - this.readyTimestamp = Date.now(); - this.emit("ready"); - }) - .on("gatewayEvent", (event, data) => this.gatewayHandler.handleWSMessage(event, data)) - .on("debug", (data) => this.emit("debug", data)) - .on("exit", () => this.emit("exit")); - this.ws.connect(); - } - - /** - * Disconnects the bot. - * - * @throws {Error} There is no active connection to disconnect. - */ - disconnect(): void { - if (!this.ws.isAlive) throw new Error("There is no active connection to disconnect."); - this.ws.emitter.removeAllListeners(); - this.ws.destroy(); - this.emit("exit"); - } - - /** - * Fetches the logged in client's servers. - * - * @returns The logged in client's servers. - */ - fetchServers(): Promise> { - return this.users.fetchServers(this.user!.id); - } - - /** - * Set current logged in client's status - * - * @param options The options for setting the status. - * @param options.content The content of the status. - * @param options.emoteId The id of the emote to use for the status. - * @param options.expiresAt The time the status should expire. - */ - async setStatus(options: { content?: string; emoteId: number; expiresAt?: Date | number | string }): Promise { - let resolvedDate; - if (options.expiresAt instanceof Date) { - resolvedDate = options.expiresAt; - } else if (typeof options.expiresAt === "string") { - resolvedDate = new Date(options.expiresAt); - } else if (typeof options.expiresAt === "number") { - resolvedDate = new Date(Date.now() + options.expiresAt); - } - - await this.rest.router.userStatus.userStatusCreate({ - userId: this.user!.id, - requestBody: { - content: options.content, - emoteId: options.emoteId, - expiresAt: resolvedDate?.toISOString() ?? undefined, - }, - }); - } - - /** - * Clear current logged in client's status - */ - async clearStatus(): Promise { - await this.rest.router.userStatus.userStatusDelete({ - userId: this.user!.id, - }); - } + /** + * The time in milliseconds since the Client connected. + */ + readyTimestamp: number | null = null; + + /** + * The manager for the bot to make requests to the REST api. + */ + rest = new RestManager({ + ...this.options.rest, + token: this.options.token, + }); + + /** + * The websocket connection. + */ + ws = new WebSocketManager({ + token: this.options.token, + }); + + /** + * The gateway events will be processed by this manager. + */ + gatewayHandler = new ClientGatewayHandler(this); + + /** + * A manager for channels, used to manage and interact with channels. + */ + channels = new GlobalChannelManager(this); + + /** + * A manager for docs, used to manage and interact with docs. + */ + docs = new GlobalDocManager(this); + + /** + * A manager for forum topics, used to manage and interact with forum topics. + */ + topics = new GlobalForumTopicManager(this); + + /** + * A manager for groups, used to manage and interact with groups. + */ + groups = new GlobalGroupManager(this); + + /** + * A manager for list items, used to manage and interact with list items. + */ + lists = new GlobalListItemManager(this); + + /** + * A manager for members, used to manage and interact with members. + */ + members = new GlobalMemberManager(this); + + /** + * A manager for messages, used to manage and interact with messages. + */ + messages = new GlobalMessageManager(this); + + /** + * A manager for roles, used to manage and interact with roles. + */ + roles = new GlobalRoleManager(this); + + /** + * A manager for users, used to manage and interact with users. + */ + users = new GlobalUserManager(this); + + /** + * A manager for guild bans, used to manage and interact with bans. + */ + bans = new GlobalGuildBanManager(this); + + /** + * A manager for webhooks, used to manage and interact with webhooks. + */ + webhooks = new GlobalWebhookManager(this); + + /** + * A manager for servers, used to manage and interact with servers. + */ + servers = new GlobalServerManager(this); + + /** + * A manager for reactions, used to manage and interact with reactions. + */ + reactions = new GlobalReactionManager(this); + + /** + * A manager for calendars, used to manage and interact with calendars. + */ + calendars = new GlobalCalendarManager(this); + + /** + * A manager for categories, used to manage and interact with categories. + */ + categories = new GlobalCategoryManager(this); + + /** + * A manager for server subscriptions, used to manage and interact with server subscriptions. + */ + subscriptions = new GlobalSubscriptionManager(this); + + /** + * The user belonging to this bot. + */ + user: ClientUser | null = null; + + /** + * @param options The options for the client. + * @throws {Error} Must provide options in client constructor in the form of an object. + * @throws {Error} No token provided. + */ + constructor(public options: ClientOptions) { + // eslint-disable-next-line constructor-super + super(); + if (typeof options !== "object") throw new Error("Must provide options in client constructor in the form of an object."); + if (typeof options?.token === "undefined") throw new Error("No token provided."); + } + + /** + * The amount of time the bot has been online in milliseconds. + */ + get uptime(): number { + return this.readyTimestamp ? Date.now() - this.readyTimestamp : 0; + } + + /** + * The bot's token. + */ + get token(): string { + return this.options.token; + } + + /** + * Connects the bot to the api. + * + * @param [opts] The options for connecting to the api. + * @param [opts.fresh] Whether this should create a new WebSocketManager instance. + * @example + * let client = new Guilded.Client({ token: process.env.GUILDED_TOKEN }); + * client.on('ready', () => console.log('Logged in!')); + * client.login(); + */ + login(opts?: { + fresh?: boolean; + }): void { + if (opts?.fresh) + this.ws = new WebSocketManager({ + token: this.options.token, + }); + this.ws.emitter + .on("error", (reason, err) => this.emit("error", `[WS] ${reason}`, err)) + .on("ready", (user) => { + this.user = new ClientUser(this, user); + this.readyTimestamp = Date.now(); + this.emit("ready"); + }) + .on("gatewayEvent", (event, data) => this.gatewayHandler.handleWSMessage(event, data)) + .on("debug", (data) => this.emit("debug", data)) + .on("exit", () => this.emit("exit")); + this.ws.connect(); + } + + /** + * Disconnects the bot. + * + * @throws {Error} There is no active connection to disconnect. + */ + disconnect(): void { + if (!this.ws.isAlive) throw new Error("There is no active connection to disconnect."); + this.ws.emitter.removeAllListeners(); + this.ws.destroy(); + this.emit("exit"); + } + + /** + * Fetches the logged in client's servers. + * + * @returns The logged in client's servers. + */ + fetchServers(): Promise> { + return this.users.fetchServers(this.user?.id!); + } + + /** + * Set current logged in client's status + * + * @param options The options for setting the status. + * @param options.content The content of the status. + * @param options.emoteId The id of the emote to use for the status. + * @param options.expiresAt The time the status should expire. + */ + async setStatus(options: { + content?: string; + emoteId: number; + expiresAt?: Date | number | string; + }): Promise { + let resolvedDate: Date; + if (options.expiresAt instanceof Date) { + resolvedDate = options.expiresAt; + } else if (typeof options.expiresAt === "string") { + resolvedDate = new Date(options.expiresAt); + } else if (typeof options.expiresAt === "number") { + resolvedDate = new Date(Date.now() + options.expiresAt); + } else { + resolvedDate = new Date(Date.now()); + } + + await this.rest.router.userStatus.userStatusCreate({ + userId: this.user!.id, + requestBody: { + content: options.content, + emoteId: options.emoteId, + expiresAt: resolvedDate.toISOString() ?? undefined, + }, + }); + } + + /** + * Clear current logged in client's status + */ + async clearStatus(): Promise { + await this.rest.router.userStatus.userStatusDelete({ + userId: this.user!.id, + }); + } } /** * Options for constructing the client. */ export type ClientOptions = { - /** - * The bot's token. - * - * @remarks The token is required to authenticate with the Guilded API. - */ - token: string; - - /** - * The RestManager options. - */ - rest?: { - /** - * The version of the API to be used for making requests. By default, this will use the latest version that the library supports. - * - * @default 1 - * @remarks You can set the API version to 1 if you want to use the stable API. - */ - version?: 1; - - /** - * The base url of the API you want to send requests to. By default, this will send it to guilded's rest API. - * This is meant for big bot developers who want to use a proxy rest system. - * - * @remarks If you want to use a custom API url, you can set this property to your custom url. - */ - proxyURL?: string; - }; - - /** - * Gateway handling options - */ - gateway?: { - /** - * A boolean returning function that dictates whether an event is discarded - */ - discardEvent?(event: string, data: SkeletonWSPayload): boolean; - }; - - /** - * The cache options for the client. - */ - cache?: { - /** - * The function to create a new instance of CacheStructure. - * - * @remarks You can use this to provide your own implementation of CacheStructure, which will be used to cache data in the client in a future update. - */ - structureBuilder?(): CacheStructure; - - /** - * Whether to fetch the author of a message when it is created and cache it. - * - * @default false - */ - fetchMessageAuthorOnCreate?: boolean; - - /** - * Whether to remove a member from the cache when they leave a server. - * - * @default true - */ - removeMemberOnLeave?: boolean; - - /** - * Whether to remove a member's ban from the cache when they are unbanned. - * - * @default true - */ - removeMemberBanOnUnban?: boolean; - - /** - * Whether to remove a channel from the cache when it is deleted. - * - * @default true - */ - removeChannelOnDelete?: boolean; - - /** - * Whether to remove a calendar from the cache when it is deleted. - * - * @default true - */ - removeCalendarsOnDelete?: boolean; - - /** - * Whether to remove a calendar RSVP from the cache when it is deleted. - * - * @default true - */ - removeCalendarRsvpOnDelete?: boolean; - - /** - * Whether to cache member bans. - * - * @default true - */ - cacheMemberBans?: boolean; - - /** - * Whether to cache webhooks. - * - * @default true - */ - cacheWebhooks?: boolean; - - /** - * Whether to cache channels. - * - * @default true - */ - cacheChannels?: boolean; - - /** - * Whether to cache servers. - * - * @default true - */ - cacheServers?: boolean; - - /** - * Whether to cache messages. - * - * @default true - */ - cacheMessages?: boolean; - - /** - * Whether to cache forum topics. - * - * @default true - */ - cacheForumTopics?: boolean; - - /** - * Whether to cache message reactions. - * - * @default true - */ - cacheMessageReactions?: boolean; - - /** - * Whether to cache calendars. - * - * @default true - */ - cacheCalendars?: boolean; - - /** - * Whether to cache calendar RSVPs. - * - * @default true - */ - cacheCalendarsRsvps?: boolean; - - /** - * Whether to cache member social links. - * - * @default true - */ - cacheSocialLinks?: boolean; - }; + /** + * The bot's token. + * + * @remarks The token is required to authenticate with the Guilded API. + */ + token: string; + + /** + * The RestManager options. + */ + rest?: { + /** + * The version of the API to be used for making requests. By default, this will use the latest version that the library supports. + * + * @default 1 + * @remarks You can set the API version to 1 if you want to use the stable API. + */ + version?: 1; + + /** + * The base url of the API you want to send requests to. By default, this will send it to guilded's rest API. + * This is meant for big bot developers who want to use a proxy rest system. + * + * @remarks If you want to use a custom API url, you can set this property to your custom url. + */ + proxyURL?: string; + }; + + /** + * Gateway handling options + */ + gateway?: { + /** + * A boolean returning function that dictates whether an event is discarded + */ + discardEvent?(event: string, data: SkeletonWSPayload): boolean; + }; + + /** + * The cache options for the client. + */ + cache?: { + /** + * The function to create a new instance of CacheStructure. + * + * @remarks You can use this to provide your own implementation of CacheStructure, which will be used to cache data in the client in a future update. + */ + structureBuilder?(): CacheStructure; + + /** + * Whether to fetch the author of a message when it is created and cache it. + * + * @default false + */ + fetchMessageAuthorOnCreate?: boolean; + + /** + * Whether to remove a member from the cache when they leave a server. + * + * @default true + */ + removeMemberOnLeave?: boolean; + + /** + * Whether to remove a member's ban from the cache when they are unbanned. + * + * @default true + */ + removeMemberBanOnUnban?: boolean; + + /** + * Whether to remove a channel from the cache when it is deleted. + * + * @default true + */ + removeChannelOnDelete?: boolean; + + /** + * Whether to remove a calendar from the cache when it is deleted. + * + * @default true + */ + removeCalendarsOnDelete?: boolean; + + /** + * Whether to remove a calendar RSVP from the cache when it is deleted. + * + * @default true + */ + removeCalendarRsvpOnDelete?: boolean; + + /** + * Whether to cache member bans. + * + * @default true + */ + cacheMemberBans?: boolean; + + /** + * Whether to cache webhooks. + * + * @default true + */ + cacheWebhooks?: boolean; + + /** + * Whether to cache channels. + * + * @default true + */ + cacheChannels?: boolean; + + /** + * Whether to cache servers. + * + * @default true + */ + cacheServers?: boolean; + + /** + * Whether to cache messages. + * + * @default true + */ + cacheMessages?: boolean; + + /** + * Whether to cache forum topics. + * + * @default true + */ + cacheForumTopics?: boolean; + + /** + * Whether to cache message reactions. + * + * @default true + */ + cacheMessageReactions?: boolean; + + /** + * Whether to cache calendars. + * + * @default true + */ + cacheCalendars?: boolean; + + /** + * Whether to cache calendar RSVPs. + * + * @default true + */ + cacheCalendarsRsvps?: boolean; + + /** + * Whether to cache member social links. + * + * @default true + */ + cacheSocialLinks?: boolean; + }; }; diff --git a/packages/guilded.js/lib/structures/Embed.ts b/packages/guilded.js/lib/structures/Embed.ts index f443d220..230faf9e 100644 --- a/packages/guilded.js/lib/structures/Embed.ts +++ b/packages/guilded.js/lib/structures/Embed.ts @@ -2,199 +2,224 @@ import type { ChatEmbedPayload, EmbedPayload } from "@guildedjs/api"; import { resolveColor } from "@guildedjs/api"; export class Embed { - title: string | null; - - description: string | null; - - url: string | null; - - timestamp: number | null; - - color: number | null; - - image: APIEmbedMediaData | null; - - thumbnail: APIEmbedMediaData | null; - - video: APIEmbedMediaData | null; - - author: { - name: string | null; - iconURL: string | null; - url: string | null; - } | null; - - fields: { - inline: boolean | null; - name: string; - value: string; - }[]; - - footer: { - text: string; - iconURL: string | null; - } | null; - - private timestampString: string | null; - - constructor(data?: Partial) { - this.footer = null; - this.image = null; - this.thumbnail = null; - this.author = null; - this.fields = []; - this.video = null; - this.color = null; - this.timestamp = null; - this.timestampString = null; - this.description = null; - this.url = null; - this.title = null; - - if (data) this._update(data); - } - - _update(data: Partial): void { - if ("color" in data) this.setColor(data.color); - if ("timestamp" in data) this.setTimestamp(data.timestamp); - if ("title" in data) this.setTitle(data.title); - if ("description" in data) this.setDescription(data.description); - if ("url" in data) this.setURL(data.url); - if ("footer" in data) this.setFooter(data.footer?.text, data.footer?.icon_url ?? null); - if ("image" in data) this.setImage(data.image?.url); - if ("thumbnail" in data) this.setThumbnail(data.thumbnail?.url); - if ("author" in data) this.setAuthor(data.author?.name, data.author?.icon_url, data.author?.url); - if ("fields" in data) this.addFields(data.fields ?? []); - } - - setTitle(title?: string | null): this { - this.title = title ?? null; - return this; - } - - setDescription(description?: string | null): this { - this.description = description ?? null; - return this; - } - - setURL(url?: string | null): this { - this.url = url ?? null; - return this; - } - - setTimestamp(timestamp?: Date | number | string | null): this { - if (timestamp === null) { - this.timestamp = null; - this.timestampString = null; - return this; - } - - if (!timestamp) { - return this.setTimestamp(new Date()); - } - - const parsedTimestamp = timestamp instanceof Date ? timestamp : Number.isInteger(timestamp) || typeof timestamp === "string" ? new Date(timestamp) : null; - if (!parsedTimestamp || (parsedTimestamp instanceof Date && Number.isNaN(parsedTimestamp.getTime()))) { - throw new TypeError("Invalid DateResolvable passed into setTimestamp."); - } - - this.timestamp = parsedTimestamp.getTime(); - this.timestampString = parsedTimestamp.toISOString(); - return this; - } - - setColor(color?: number | string | [number, number, number] | null): this { - this.color = color ? resolveColor(color) : null; - return this; - } - - setFooter(text?: string, iconURL?: string | null): this { - this.footer = text ? { iconURL: iconURL ?? null, text } : null; - return this; - } - - setImage(url?: string): this { - this.image = url ? { url } : null; - return this; - } - - setThumbnail(url?: string): this { - this.thumbnail = url ? { url } : null; - return this; - } - - setAuthor(name?: string, iconURL?: string | null, url?: string | null): this { - this.author = name - ? { - iconURL: iconURL ?? null, - name: name ?? null, - url: url ?? null, - } - : null; - return this; - } - - addFields(fields: { name: string; value: string; inline?: boolean }[]): this { - this.fields.push( - ...fields.map((field) => ({ - inline: field.inline ?? false, - name: field.name, - value: field.value, - })), - ); - return this; - } - - addField(name: string, value: string, inline?: boolean): this { - this.addFields([{ inline, name, value }]); - return this; - } - - clearFields(): this { - this.fields.length = 0; - return this; - } - - toJSON(): EmbedPayload { - return { - author: this.author?.name - ? { - icon_url: this.author.iconURL ?? undefined, - name: this.author.name, - url: this.author.url ?? undefined, - } - : undefined, - color: this.color ?? undefined, - description: this.description ?? undefined, - fields: - this.fields.map((field) => ({ - inline: field.inline ?? false, - name: field.name, - value: field.value, - })) ?? undefined, - footer: this.footer - ? { - icon_url: this.footer.iconURL ?? undefined, - text: this.footer.text ?? undefined, - } - : undefined, - image: this.image - ? { - url: this.image.url ?? undefined, - } - : undefined, - thumbnail: this.thumbnail - ? { - url: this.thumbnail.url ?? undefined, - } - : undefined, - timestamp: this.timestampString ?? undefined, - title: this.title ?? undefined, - url: this.url ?? undefined, - }; - } + title: string | null; + + description: string | null; + + url: string | null; + + timestamp: number | null; + + color: number | null; + + image: APIEmbedMediaData | null; + + thumbnail: APIEmbedMediaData | null; + + video: APIEmbedMediaData | null; + + author: { + name: string | null; + iconURL: string | null; + url: string | null; + } | null; + + fields: { + inline: boolean | null; + name: string; + value: string; + }[]; + + footer: { + text: string; + iconURL: string | null; + } | null; + + private timestampString: string | null; + + constructor(data?: Partial) { + this.footer = null; + this.image = null; + this.thumbnail = null; + this.author = null; + this.fields = []; + this.video = null; + this.color = null; + this.timestamp = null; + this.timestampString = null; + this.description = null; + this.url = null; + this.title = null; + + if (data) this._update(data); + } + + _update(data: Partial): void { + if ("color" in data) this.setColor(data.color); + if ("timestamp" in data) this.setTimestamp(data.timestamp); + if ("title" in data) this.setTitle(data.title); + if ("description" in data) this.setDescription(data.description); + if ("url" in data) this.setURL(data.url); + if ("footer" in data) this.setFooter(data.footer?.text, data.footer?.icon_url ?? null); + if ("image" in data) this.setImage(data.image?.url); + if ("thumbnail" in data) this.setThumbnail(data.thumbnail?.url); + if ("author" in data) this.setAuthor(data.author?.name, data.author?.icon_url, data.author?.url); + if ("fields" in data) this.addFields(data.fields ?? []); + } + + setTitle(title?: string | null): this { + this.title = title ?? null; + return this; + } + + setDescription(description?: string | null): this { + this.description = description ?? null; + return this; + } + + setURL(url?: string | null): this { + this.url = url ?? null; + return this; + } + + setTimestamp(timestamp?: Date | number | string | null): this { + if (timestamp === null) { + this.timestamp = null; + this.timestampString = null; + return this; + } + + if (!timestamp) { + return this.setTimestamp(new Date()); + } + + const parsedTimestamp = timestamp instanceof Date ? timestamp : Number.isInteger(timestamp) || typeof timestamp === "string" ? new Date(timestamp) : null; + if (!parsedTimestamp || (parsedTimestamp instanceof Date && Number.isNaN(parsedTimestamp.getTime()))) { + throw new TypeError("Invalid DateResolvable passed into setTimestamp."); + } + + this.timestamp = parsedTimestamp.getTime(); + this.timestampString = parsedTimestamp.toISOString(); + return this; + } + + setColor(color?: number | string | [number, number, number] | null): this { + this.color = color ? resolveColor(color) : null; + return this; + } + + setFooter(text?: string, iconURL?: string | null): this { + this.footer = text + ? { + iconURL: iconURL ?? null, + text, + } + : null; + return this; + } + + setImage(url?: string): this { + this.image = url + ? { + url, + } + : null; + return this; + } + + setThumbnail(url?: string): this { + this.thumbnail = url + ? { + url, + } + : null; + return this; + } + + setAuthor(name?: string, iconURL?: string | null, url?: string | null): this { + this.author = name + ? { + iconURL: iconURL ?? null, + name: name ?? null, + url: url ?? null, + } + : null; + return this; + } + + addFields( + fields: { + name: string; + value: string; + inline?: boolean; + }[], + ): this { + this.fields.push( + ...fields.map((field) => ({ + inline: field.inline ?? false, + name: field.name, + value: field.value, + })), + ); + return this; + } + + addField(name: string, value: string, inline?: boolean): this { + this.addFields([ + { + inline, + name, + value, + }, + ]); + return this; + } + + clearFields(): this { + this.fields.length = 0; + return this; + } + + toJSON(): EmbedPayload { + return { + author: this.author?.name + ? { + icon_url: this.author.iconURL ?? undefined, + name: this.author.name, + url: this.author.url ?? undefined, + } + : undefined, + color: this.color ?? undefined, + description: this.description ?? undefined, + fields: + this.fields.map((field) => ({ + inline: field.inline ?? false, + name: field.name, + value: field.value, + })) ?? undefined, + footer: this.footer + ? { + icon_url: this.footer.iconURL ?? undefined, + text: this.footer.text ?? undefined, + } + : undefined, + image: this.image + ? { + url: this.image.url ?? undefined, + } + : undefined, + thumbnail: this.thumbnail + ? { + url: this.thumbnail.url ?? undefined, + } + : undefined, + timestamp: this.timestampString ?? undefined, + title: this.title ?? undefined, + url: this.url ?? undefined, + }; + } } export type APIEmbedMediaData = { - url: string; + url: string; }; diff --git a/packages/guilded.js/lib/structures/Forum.ts b/packages/guilded.js/lib/structures/Forum.ts index 454b66f4..90b7f977 100644 --- a/packages/guilded.js/lib/structures/Forum.ts +++ b/packages/guilded.js/lib/structures/Forum.ts @@ -1,4 +1,4 @@ -import type { ForumTopicPayload, MentionsPayload, ForumTopicSummaryPayload } from "@guildedjs/api"; +import type { ForumTopicPayload, ForumTopicSummaryPayload, MentionsPayload } from "@guildedjs/api"; import { parseToStamp } from "../util"; import { Base } from "./Base"; import type { Client } from "./Client"; @@ -7,240 +7,252 @@ import type { Client } from "./Client"; * Represents a forum topic in Guilded. */ export class ForumTopic extends Base { - /** - * The server ID of the forum topic. - */ - readonly serverId: string; - - /** - * The channel ID of the forum topic. - */ - readonly channelId: string; - - /** - * The title of the forum topic. - */ - title!: string; - - /** - * The creation date of the forum topic. - */ - readonly _createdAt: number; - - /** - * The user ID of the user who created the forum topic. - */ - readonly createdBy: string; - - /** - * The date time the forum topic was last updated, or null if it hasn't been updated. - */ - _updatedAt!: number | null; - - /** - * The date time the forum topic was last bumped, or null if it hasn't been bumped. - */ - _bumpedAt!: number | null; - - /** - * The date time the forum topic was deleted, or null if it hasn't been deleted. - */ - _deletedAt: number | null; - - /** - * Whether the forum topic is pinned. - */ - isPinned: boolean; - - /** - * Whether the forum topic is locked. - */ - isLocked: boolean; - - /** - * The content of the forum topic. - */ - content!: string; - - /** - * The mentions in the forum topic. - */ - mentions!: MentionsPayload; - - constructor(client: Client, data: ForumTopicPayload) { - super(client, data); - this.serverId = data.serverId; - this.channelId = data.channelId; - this._createdAt = parseToStamp(data.createdAt)!; - this.createdBy = data.createdBy; - this.isPinned = false; - this.isLocked = false; - this._deletedAt = null; - - this._update(data); - } - - /** - * Gets the creation date of the forum topic. - * - * @returns A Date object - */ - get createdAt(): Date { - return new Date(this._createdAt); - } - - /** - * Gets the date the forum topic was deleted, or null if it hasn't been deleted. - * - * @returns A Date object - */ - get deletedAt(): Date | null { - return this._deletedAt ? new Date(this._deletedAt) : null; - } - - /** - * Gets the date the forum topic was last updated, or null if it hasn't been updated. - * - * @returns A Date object - */ - get updatedAt(): Date | null { - return this._updatedAt ? new Date(this._updatedAt) : null; - } - - _update(data: Partial): this { - if ("updatedAt" in data && typeof data.updatedAt !== "undefined") { - this._updatedAt = data.updatedAt ? parseToStamp(data.updatedAt) : null; - } - - if ("_deletedAt" in data && typeof data._deletedAt !== "undefined") { - this._deletedAt = data._deletedAt.getTime(); - } - - if ("bumpedAt" in data && typeof data.bumpedAt !== "undefined") { - this._bumpedAt = data.bumpedAt ? parseToStamp(data.bumpedAt) : null; - } - - if ("isPinned" in data && typeof data.isPinned !== "undefined") { - this.isPinned = data.isPinned; - } - - if ("isLocked" in data && typeof data.isLocked !== "undefined") { - this.isLocked = data.isLocked; - } - - if ("title" in data && typeof data.title !== "undefined") { - this.title = data.title; - } - - if ("content" in data && typeof data.content !== "undefined") { - this.content = data.content; - } - - if ("mentions" in data && typeof data.mentions !== "undefined") { - this.mentions = data.mentions; - } - - return this; - } + /** + * The server ID of the forum topic. + */ + readonly serverId: string; + + /** + * The channel ID of the forum topic. + */ + readonly channelId: string; + + /** + * The title of the forum topic. + */ + title!: string; + + /** + * The creation date of the forum topic. + */ + readonly _createdAt: number; + + /** + * The user ID of the user who created the forum topic. + */ + readonly createdBy: string; + + /** + * The date time the forum topic was last updated, or null if it hasn't been updated. + */ + _updatedAt!: number | null; + + /** + * The date time the forum topic was last bumped, or null if it hasn't been bumped. + */ + _bumpedAt!: number | null; + + /** + * The date time the forum topic was deleted, or null if it hasn't been deleted. + */ + _deletedAt: number | null; + + /** + * Whether the forum topic is pinned. + */ + isPinned: boolean; + + /** + * Whether the forum topic is locked. + */ + isLocked: boolean; + + /** + * The content of the forum topic. + */ + content!: string; + + /** + * The mentions in the forum topic. + */ + mentions!: MentionsPayload; + + constructor(client: Client, data: ForumTopicPayload) { + super(client, data); + this.serverId = data.serverId; + this.channelId = data.channelId; + this._createdAt = parseToStamp(data.createdAt)!; + this.createdBy = data.createdBy; + this.isPinned = false; + this.isLocked = false; + this._deletedAt = null; + + this._update(data); + } + + /** + * Gets the creation date of the forum topic. + * + * @returns A Date object + */ + get createdAt(): Date { + return new Date(this._createdAt); + } + + /** + * Gets the date the forum topic was deleted, or null if it hasn't been deleted. + * + * @returns A Date object + */ + get deletedAt(): Date | null { + return this._deletedAt ? new Date(this._deletedAt) : null; + } + + /** + * Gets the date the forum topic was last updated, or null if it hasn't been updated. + * + * @returns A Date object + */ + get updatedAt(): Date | null { + return this._updatedAt ? new Date(this._updatedAt) : null; + } + + _update( + data: Partial< + ForumTopicPayload & { + _deletedAt?: Date; + } + >, + ): this { + if ("updatedAt" in data && typeof data.updatedAt !== "undefined") { + this._updatedAt = data.updatedAt ? parseToStamp(data.updatedAt) : null; + } + + if ("_deletedAt" in data && typeof data._deletedAt !== "undefined") { + this._deletedAt = data._deletedAt.getTime(); + } + + if ("bumpedAt" in data && typeof data.bumpedAt !== "undefined") { + this._bumpedAt = data.bumpedAt ? parseToStamp(data.bumpedAt) : null; + } + + if ("isPinned" in data && typeof data.isPinned !== "undefined") { + this.isPinned = data.isPinned; + } + + if ("isLocked" in data && typeof data.isLocked !== "undefined") { + this.isLocked = data.isLocked; + } + + if ("title" in data && typeof data.title !== "undefined") { + this.title = data.title; + } + + if ("content" in data && typeof data.content !== "undefined") { + this.content = data.content; + } + + if ("mentions" in data && typeof data.mentions !== "undefined") { + this.mentions = data.mentions; + } + + return this; + } } /** A partial summary representation of a forum topic. Can fetch this topic to get full data */ export class PartialForumTopic extends Base { - /** - * The ID of the server this role belongs to - */ - readonly serverId: string; - - /** - * The date time the forum topic was last updated, or null if it hasn't been updated. - */ - _updatedAt!: number | null; - - /** - * The date time the forum topic was last bumped, or null if it hasn't been bumped. - */ - _bumpedAt!: number | null; - - /** - * The title of the forum topic. - */ - title!: string; - - /** - * Whether the forum topic is pinned. - */ - isPinned: boolean; - - /** - * The creation date of the forum topic. - */ - readonly _createdAt: number; - - /** - * The user ID of the user who created the forum topic. - */ - readonly createdBy: string; - - /** - * The channel ID of the forum topic. - */ - readonly channelId: string; - - constructor(client: Client, data: ForumTopicSummaryPayload) { - super(client, data); - this.serverId = data.serverId; - this.channelId = data.channelId; - this._createdAt = parseToStamp(data.createdAt)!; - this.createdBy = data.createdBy; - this.isPinned = false; - - this._update(data); - } - - _update(data: Partial): this { - if ("updatedAt" in data && typeof data.updatedAt !== "undefined") { - this._updatedAt = data.updatedAt ? parseToStamp(data.updatedAt) : null; - } - - if ("bumpedAt" in data && typeof data.bumpedAt !== "undefined") { - this._bumpedAt = data.bumpedAt ? parseToStamp(data.bumpedAt) : null; - } - - if ("isPinned" in data && typeof data.isPinned !== "undefined") { - this.isPinned = data.isPinned; - } - - if ("title" in data && typeof data.title !== "undefined") { - this.title = data.title; - } - - return this; - } - - /** - * Gets the creation date of the forum topic. - * - * @returns A Date object - */ - get createdAt(): Date { - return new Date(this._createdAt); - } - - /** - * Gets the date the forum topic was last updated, or null if it hasn't been updated. - * - * @returns A Date object - */ - get updatedAt(): Date | null { - return this._updatedAt ? new Date(this._updatedAt) : null; - } - - /** - * Fetch the full member object of this partial member - * - * @returns A promise containing the resolved full member. - */ - fetch(): Promise { - return this.client.topics.fetch(this.serverId, this.id); - } + /** + * The ID of the server this role belongs to + */ + readonly serverId: string; + + /** + * The date time the forum topic was last updated, or null if it hasn't been updated. + */ + _updatedAt!: number | null; + + /** + * The date time the forum topic was last bumped, or null if it hasn't been bumped. + */ + _bumpedAt!: number | null; + + /** + * The title of the forum topic. + */ + title!: string; + + /** + * Whether the forum topic is pinned. + */ + isPinned: boolean; + + /** + * The creation date of the forum topic. + */ + readonly _createdAt: number; + + /** + * The user ID of the user who created the forum topic. + */ + readonly createdBy: string; + + /** + * The channel ID of the forum topic. + */ + readonly channelId: string; + + constructor(client: Client, data: ForumTopicSummaryPayload) { + super(client, data); + this.serverId = data.serverId; + this.channelId = data.channelId; + this._createdAt = parseToStamp(data.createdAt)!; + this.createdBy = data.createdBy; + this.isPinned = false; + + this._update(data); + } + + _update( + data: Partial< + ForumTopicPayload & { + _deletedAt?: Date; + } + >, + ): this { + if ("updatedAt" in data && typeof data.updatedAt !== "undefined") { + this._updatedAt = data.updatedAt ? parseToStamp(data.updatedAt) : null; + } + + if ("bumpedAt" in data && typeof data.bumpedAt !== "undefined") { + this._bumpedAt = data.bumpedAt ? parseToStamp(data.bumpedAt) : null; + } + + if ("isPinned" in data && typeof data.isPinned !== "undefined") { + this.isPinned = data.isPinned; + } + + if ("title" in data && typeof data.title !== "undefined") { + this.title = data.title; + } + + return this; + } + + /** + * Gets the creation date of the forum topic. + * + * @returns A Date object + */ + get createdAt(): Date { + return new Date(this._createdAt); + } + + /** + * Gets the date the forum topic was last updated, or null if it hasn't been updated. + * + * @returns A Date object + */ + get updatedAt(): Date | null { + return this._updatedAt ? new Date(this._updatedAt) : null; + } + + /** + * Fetch the full member object of this partial member + * + * @returns A promise containing the resolved full member. + */ + fetch(): Promise { + return this.client.topics.fetch(this.serverId, this.id); + } } diff --git a/packages/guilded.js/lib/structures/Group.ts b/packages/guilded.js/lib/structures/Group.ts index 50c9dbe1..7cb9228a 100644 --- a/packages/guilded.js/lib/structures/Group.ts +++ b/packages/guilded.js/lib/structures/Group.ts @@ -6,86 +6,86 @@ import type { Client } from "./Client"; * A group in a server in Guilded */ export class Group extends Base { - /** The name of the group */ - public name!: string; - - /** The description of the group */ - public description!: string; - - /** The ID of the server this group is in */ - public serverId: string; - - /** The ID of the user who created this group */ - public createdBy: string; - - /** The date this group was created at */ - public createdAt: Date; - - /** The date this group was last updated at */ - public updatedAt!: Date; - - // Avatar of this group - public avatar!: string; - - // Whether this is the main group in a server - public isHome!: boolean; - - // ID of the emote for this group - public emoteId!: number; - - // Whether this group is public - public isPublic!: boolean; - - // ID of the user who last updated this group - public updatedBy!: string; - - // Date this group was archived if it was archived - public archivedAt!: Date | null; - - // ID of the user who archived this group if it was archived - public archivedBy!: string | null; - - constructor(client: Client, data: GroupPayload) { - super(client, data); - this.serverId = data.serverId; - this.createdAt = new Date(Date.parse(data.createdAt)); - this.createdBy = data.createdBy; - - this._update(data); - } - - _update(data: GroupPayload): this { - if (typeof data.name !== "undefined") this.name = data.name; - if (typeof data.description !== "undefined") this.description = data.description; - if (typeof data.updatedAt !== "undefined") this.updatedAt = new Date(Date.parse(data.updatedAt)); - if (typeof data.avatar !== "undefined") this.avatar = data.avatar; - if (typeof data.isHome !== "undefined") this.isHome = data.isHome; - if (typeof data.emoteId !== "undefined") this.emoteId = data.emoteId; - if (typeof data.isPublic !== "undefined") this.isPublic = data.isPublic; - if (typeof data.updatedBy !== "undefined") this.updatedBy = data.updatedBy; - if (typeof data.archivedAt !== "undefined") this.archivedAt = data.archivedAt ? new Date(Date.parse(data.archivedAt)) : null; - if (typeof data.archivedBy !== "undefined") this.archivedBy = data.archivedBy; - - return this; - } - - /** - * Adds a member to the group. - * - * @param memberId The ID of the member to add. - * @returns A Promise that resolves with no result on success. - */ - addMember(memberId: string): Promise { - return this.client.groups.addMember(this.id, memberId); - } - - /** - * Removes a member from the group. - * - * @param memberId The ID of the member to remove. - * @returns A Promise that resolves with no result on success. - */ - removeMember(memberId: string): Promise { - return this.client.groups.removeMember(this.id, memberId); - } + /** The name of the group */ + public name!: string; + + /** The description of the group */ + public description!: string; + + /** The ID of the server this group is in */ + public serverId: string; + + /** The ID of the user who created this group */ + public createdBy: string; + + /** The date this group was created at */ + public createdAt: Date; + + /** The date this group was last updated at */ + public updatedAt!: Date; + + // Avatar of this group + public avatar!: string; + + // Whether this is the main group in a server + public isHome!: boolean; + + // ID of the emote for this group + public emoteId!: number; + + // Whether this group is public + public isPublic!: boolean; + + // ID of the user who last updated this group + public updatedBy!: string; + + // Date this group was archived if it was archived + public archivedAt!: Date | null; + + // ID of the user who archived this group if it was archived + public archivedBy!: string | null; + + constructor(client: Client, data: GroupPayload) { + super(client, data); + this.serverId = data.serverId; + this.createdAt = new Date(Date.parse(data.createdAt)); + this.createdBy = data.createdBy; + + this._update(data); + } + + _update(data: GroupPayload): this { + if (typeof data.name !== "undefined") this.name = data.name; + if (typeof data.description !== "undefined") this.description = data.description; + if (typeof data.updatedAt !== "undefined") this.updatedAt = new Date(Date.parse(data.updatedAt)); + if (typeof data.avatar !== "undefined") this.avatar = data.avatar; + if (typeof data.isHome !== "undefined") this.isHome = data.isHome; + if (typeof data.emoteId !== "undefined") this.emoteId = data.emoteId; + if (typeof data.isPublic !== "undefined") this.isPublic = data.isPublic; + if (typeof data.updatedBy !== "undefined") this.updatedBy = data.updatedBy; + if (typeof data.archivedAt !== "undefined") this.archivedAt = data.archivedAt ? new Date(Date.parse(data.archivedAt)) : null; + if (typeof data.archivedBy !== "undefined") this.archivedBy = data.archivedBy; + + return this; + } + + /** + * Adds a member to the group. + * + * @param memberId The ID of the member to add. + * @returns A Promise that resolves with no result on success. + */ + addMember(memberId: string): Promise { + return this.client.groups.addMember(this.id, memberId); + } + + /** + * Removes a member from the group. + * + * @param memberId The ID of the member to remove. + * @returns A Promise that resolves with no result on success. + */ + removeMember(memberId: string): Promise { + return this.client.groups.removeMember(this.id, memberId); + } } diff --git a/packages/guilded.js/lib/structures/Member.ts b/packages/guilded.js/lib/structures/Member.ts index 4c60b67d..962f8c94 100644 --- a/packages/guilded.js/lib/structures/Member.ts +++ b/packages/guilded.js/lib/structures/Member.ts @@ -7,262 +7,272 @@ import type { Client } from "./Client"; import type { User } from "./User"; export class Member extends Base { - /** The ID of the server this role belongs to */ - readonly serverId: string; - - /** The nickname for this member */ - nickname: string | null = null; - - /** Date this member joined */ - _joinedAt: number | null; - - /** Roles this member has by ID (TODO: role object when Guilded API has one) */ - roleIds: number[] = []; - - /** Whether this member has been kicked */ - kicked: boolean; - - /** Whether this member has been banned */ - banned: boolean; - - /** Whether this member owns the server */ - isOwner: boolean; - - /** Cached social links of this member */ - socialLinks: Collection; - - constructor(client: Client, data: UpgradedServerMemberPayload) { - super(client, data); - this.serverId = data.serverId; - this._joinedAt = parseToStamp(data.joinedAt); - this.kicked = false; - this.banned = false; - this.isOwner = false; - this.socialLinks = new Collection(); - - this._update(data); - } - - get joinedAt(): Date | null { - return this._joinedAt ? new Date(this._joinedAt) : null; - } - - _update(data: Partial): this { - if ("nickname" in data) { - this.nickname = data.nickname ?? null; - } - - if ("roleIds" in data && typeof data.roleIds !== "undefined") { - this.roleIds = data.roleIds; - } - - if ("kicked" in data && typeof data.kicked !== "undefined") { - this.kicked = data.kicked; - } - - if ("banned" in data && typeof data.banned !== "undefined") { - this.banned = data.banned; - } - - if ("isOwner" in data && typeof data.isOwner !== "undefined") { - this.isOwner = data.isOwner; - } - - return this; - } - - /** - * Get the user associated with this member. - * - * @returns The user associated with this member or null if the user is not cached. - */ - get user(): User | null { - return this.client.users.cache.get(this.id) ?? null; - } - - /** - * The username of this member. - * - * @returns The username of this member or null if the user is not cached. - */ - get username(): string | null { - return this.user?.name ?? null; - } - - /** - * Either the nickname or the username associated with this member. - * - * @returns The nickname of this member or their username if they have no nickname, or null if the user does not exist. - */ - get displayName(): string | null { - return this.nickname ?? this.username; - } - - /** - * Get a list of the roles assigned to this member. - * - * @returns A Promise that resolves with an array of role IDs assigned to this member. - */ - getRoles(): Promise { - return this.client.members.getRoles(this.serverId, this.id); - } - - /** - * Update this member's nickname. - * - * @param nickname - The new nickname for the member. - * @returns A Promise that resolves with the new nickname for the member. - */ - updateNickname(nickname: string): Promise { - return this.client.members.updateNickname(this.serverId, this.id, nickname); - } - - /** - * Reset this member's nickname. - * - * @returns A Promise that resolves once the member's nickname has been reset. - */ - resetNickname(): Promise { - return this.client.members.resetNickname(this.serverId, this.id); - } - - /** - * Award XP to this member. - * - * @param amount - The amount of XP to award to the member. - * @returns A Promise that resolves with the new total amount of XP the member has. - */ - awardXP(amount: number): Promise { - return this.client.members.giveXP(this.serverId, this.id, amount); - } - - /** - * Add role to this member. - * - * @param roleId - The ID of the role to add to the member. - * @returns A Promise that resolves once the role has been added to the member. - */ - addRole(roleId: number): Promise { - return this.client.roles.addRoleToMember(this.serverId, this.id, roleId); - } - - /** - * Remove role from this member. - * - * @param roleId - The ID of the role to remove from the member. - * @returns A Promise that resolves once the role has been removed from the member. - */ - removeRole(roleId: number): Promise { - return this.client.roles.removeRoleFromMember(this.serverId, this.id, roleId); - } - - /** - * Kick this user from the server. - * - * @returns A Promise that resolves with the kicked member or null if the user is not a member of the server. - */ - kick(): Promise { - return this.client.members.kick(this.serverId, this.id); - } - - /** - * Ban this user - * - * @returns A Promise that resolved to the created member ban. - */ - ban(): Promise { - return this.client.bans.ban(this.serverId, this.id); - } + /** The ID of the server this role belongs to */ + readonly serverId: string; + + /** The nickname for this member */ + nickname: string | null = null; + + /** Date this member joined */ + _joinedAt: number | null; + + /** Roles this member has by ID (TODO: role object when Guilded API has one) */ + roleIds: number[] = []; + + /** Whether this member has been kicked */ + kicked: boolean; + + /** Whether this member has been banned */ + banned: boolean; + + /** Whether this member owns the server */ + isOwner: boolean; + + /** Cached social links of this member */ + socialLinks: Collection; + + constructor(client: Client, data: UpgradedServerMemberPayload) { + super(client, data); + this.serverId = data.serverId; + this._joinedAt = parseToStamp(data.joinedAt); + this.kicked = false; + this.banned = false; + this.isOwner = false; + this.socialLinks = new Collection(); + + this._update(data); + } + + get joinedAt(): Date | null { + return this._joinedAt ? new Date(this._joinedAt) : null; + } + + _update( + data: Partial< + ServerMemberPayload & { + kicked: boolean; + banned: boolean; + } + >, + ): this { + if ("nickname" in data) { + this.nickname = data.nickname ?? null; + } + + if ("roleIds" in data && typeof data.roleIds !== "undefined") { + this.roleIds = data.roleIds; + } + + if ("kicked" in data && typeof data.kicked !== "undefined") { + this.kicked = data.kicked; + } + + if ("banned" in data && typeof data.banned !== "undefined") { + this.banned = data.banned; + } + + if ("isOwner" in data && typeof data.isOwner !== "undefined") { + this.isOwner = data.isOwner; + } + + return this; + } + + /** + * Get the user associated with this member. + * + * @returns The user associated with this member or null if the user is not cached. + */ + get user(): User | null { + return this.client.users.cache.get(this.id) ?? null; + } + + /** + * The username of this member. + * + * @returns The username of this member or null if the user is not cached. + */ + get username(): string | null { + return this.user?.name ?? null; + } + + /** + * Either the nickname or the username associated with this member. + * + * @returns The nickname of this member or their username if they have no nickname, or null if the user does not exist. + */ + get displayName(): string | null { + return this.nickname ?? this.username; + } + + /** + * Get a list of the roles assigned to this member. + * + * @returns A Promise that resolves with an array of role IDs assigned to this member. + */ + getRoles(): Promise { + return this.client.members.getRoles(this.serverId, this.id); + } + + /** + * Update this member's nickname. + * + * @param nickname - The new nickname for the member. + * @returns A Promise that resolves with the new nickname for the member. + */ + updateNickname(nickname: string): Promise { + return this.client.members.updateNickname(this.serverId, this.id, nickname); + } + + /** + * Reset this member's nickname. + * + * @returns A Promise that resolves once the member's nickname has been reset. + */ + resetNickname(): Promise { + return this.client.members.resetNickname(this.serverId, this.id); + } + + /** + * Award XP to this member. + * + * @param amount - The amount of XP to award to the member. + * @returns A Promise that resolves with the new total amount of XP the member has. + */ + awardXP(amount: number): Promise { + return this.client.members.giveXP(this.serverId, this.id, amount); + } + + /** + * Add role to this member. + * + * @param roleId - The ID of the role to add to the member. + * @returns A Promise that resolves once the role has been added to the member. + */ + addRole(roleId: number): Promise { + return this.client.roles.addRoleToMember(this.serverId, this.id, roleId); + } + + /** + * Remove role from this member. + * + * @param roleId - The ID of the role to remove from the member. + * @returns A Promise that resolves once the role has been removed from the member. + */ + removeRole(roleId: number): Promise { + return this.client.roles.removeRoleFromMember(this.serverId, this.id, roleId); + } + + /** + * Kick this user from the server. + * + * @returns A Promise that resolves with the kicked member or null if the user is not a member of the server. + */ + kick(): Promise { + return this.client.members.kick(this.serverId, this.id); + } + + /** + * Ban this user + * + * @returns A Promise that resolved to the created member ban. + */ + ban(): Promise { + return this.client.bans.ban(this.serverId, this.id); + } } /** A partial summary representation of a member. Can fetch this member to get full data */ export class PartialMember extends Base { - /** The ID of the server this role belongs to */ - readonly serverId: string; - - /** The user information of this member */ - readonly user: UserSummaryPayload; - - /** Roles this member has by ID (TODO: role object when Guilded API has one) */ - readonly roleIds: number[] = []; - - constructor(client: Client, data: UpgradedServerMemberSummaryPayload) { - super(client, data); - this.serverId = data.serverId; - this.user = data.user; - this.roleIds = data.roleIds; - } - - /** - * Fetch the full member object of this partial member - * - * @returns A promise containing the resolved full member. - */ - fetch(): Promise { - return this.client.members.fetch(this.serverId, this.user.id); - } + /** The ID of the server this role belongs to */ + readonly serverId: string; + + /** The user information of this member */ + readonly user: UserSummaryPayload; + + /** Roles this member has by ID (TODO: role object when Guilded API has one) */ + readonly roleIds: number[] = []; + + constructor(client: Client, data: UpgradedServerMemberSummaryPayload) { + super(client, data); + this.serverId = data.serverId; + this.user = data.user; + this.roleIds = data.roleIds; + } + + /** + * Fetch the full member object of this partial member + * + * @returns A promise containing the resolved full member. + */ + fetch(): Promise { + return this.client.members.fetch(this.serverId, this.user.id); + } } /** * Represents a banned member. */ export class MemberBan extends Base { - /** Id this ban was created in */ - serverId: string; - - /** Date this ban was created */ - _createdAt: number; - - /** The ID of user who banned this person */ - createdById: string; - - /** The reason this user was banned */ - reason: string | null; - - /** Information about the target user */ - target: UserSummaryPayload; - - /** - * Creates a new instance of `MemberBan`. - * - * @param client - The Guilded client instance. - * @param data - The data for this member ban. - */ - constructor(client: Client, data: UpgradedServerMemberBanPayload) { - const transformedBanId = buildMemberKey(data.serverId, data.user.id); - super(client, { ...data, id: transformedBanId }); - - this.serverId = data.serverId; - this._createdAt = parseToStamp(data.createdAt)!; - this.createdById = data.createdBy; - this.target = data.user; - this.reason = data.reason ?? null; - } - - /** - * Gets the creation date of this ban. - * - * @returns The creation date of this ban. - */ - get createdAt(): Date { - return new Date(this._createdAt); - } - - /** - * Gets the user who banned this member. - * - * @returns The user who banned this member, or `null` if the user is not cached. - */ - get author(): User | null { - return this.client.users.cache.get(this.createdById) ?? null; - } - - /** - * Removes this ban. - * - * @returns A Promise that resolves to the unbanned member or `null` if the member is not cached. - */ - unban(): Promise { - return this.client.bans.unban(this.serverId, this.target.id); - } + /** Id this ban was created in */ + serverId: string; + + /** Date this ban was created */ + _createdAt: number; + + /** The ID of user who banned this person */ + createdById: string; + + /** The reason this user was banned */ + reason: string | null; + + /** Information about the target user */ + target: UserSummaryPayload; + + /** + * Creates a new instance of `MemberBan`. + * + * @param client - The Guilded client instance. + * @param data - The data for this member ban. + */ + constructor(client: Client, data: UpgradedServerMemberBanPayload) { + const transformedBanId = buildMemberKey(data.serverId, data.user.id); + super(client, { + ...data, + id: transformedBanId, + }); + + this.serverId = data.serverId; + this._createdAt = parseToStamp(data.createdAt)!; + this.createdById = data.createdBy; + this.target = data.user; + this.reason = data.reason ?? null; + } + + /** + * Gets the creation date of this ban. + * + * @returns The creation date of this ban. + */ + get createdAt(): Date { + return new Date(this._createdAt); + } + + /** + * Gets the user who banned this member. + * + * @returns The user who banned this member, or `null` if the user is not cached. + */ + get author(): User | null { + return this.client.users.cache.get(this.createdById) ?? null; + } + + /** + * Removes this ban. + * + * @returns A Promise that resolves to the unbanned member or `null` if the member is not cached. + */ + unban(): Promise { + return this.client.bans.unban(this.serverId, this.target.id); + } } diff --git a/packages/guilded.js/lib/structures/Message.ts b/packages/guilded.js/lib/structures/Message.ts index 6dc9668c..c61bfa05 100644 --- a/packages/guilded.js/lib/structures/Message.ts +++ b/packages/guilded.js/lib/structures/Message.ts @@ -12,311 +12,320 @@ import type { ThreadChannel } from "./channels/ThreadChannel"; import type { CollectorOptions, CollectorReturnValue } from "./collectors/Collector"; export enum MessageType { - Default, - System, + Default = 0, + System = 1, } export class Message extends Base { - /** The ID of the channel */ - readonly channelId: string; + /** The ID of the channel */ + readonly channelId: string; - /** The ID of the server this message belongs to */ - readonly serverId: string | null; + /** The ID of the server this message belongs to */ + readonly serverId: string | null; - /** The ID of the group this message was posted in */ - readonly groupId: string | null; - - /** The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated. */ - readonly type: MessageType; - - /** The content of the message */ - content: string; - - /** The mentions within this message */ - mentions?: MentionsPayload; - - /** The ID of the messages that this is replying to. */ - readonly replyMessageIds: string[] = []; - - /** If set, this message will only be seen by those mentioned or replied to. */ - readonly isPrivate: boolean; - - /** If set, this message did not notify, mention or reply recipients. */ - readonly isSilent: boolean; - - /** The ID of the user who created this message (Note: If this event has createdByBotId or createdByWebhookId present, this field will still be populated, but can be ignored. In these cases, the value of this field will always be Ann6LewA) */ - readonly createdById: string; - - /** Bool value to wether message is a reply or not */ - readonly isReply: boolean; - - /** The ID of the webhook who created this message, if it was created by a webhook */ - readonly createdByWebhookId: string | null; - - /** The timestamp that the message was created at. */ - readonly _createdAt: number; - - /** The timestamp that the message was updated at, if relevant */ - _updatedAt: number | null; - - /** Whether the message has been deleted */ - deleted = false; - - /** When the message was deleted, if it was */ - _deletedAt: number | null = null; - - /** Embeds contained within this message */ - embeds: Embed[] = []; - - constructor(client: Client, data: ChatMessagePayload) { - super(client, data); - this.isReply = Boolean(data.replyMessageIds); - this.channelId = data.channelId; - this.groupId = data.groupId ?? null; - this.content = data.content ?? ""; - this.serverId = data.serverId ?? null; - this.replyMessageIds = data.replyMessageIds ?? []; - this.createdById = data.createdBy; - this.createdByWebhookId = data.createdByWebhookId ?? null; - this._createdAt = parseToStamp(data.createdAt)!; - this._updatedAt = null; - this.isPrivate = data.isPrivate ?? false; - this.isSilent = data.isSilent ?? false; - this.type = data.type === "system" ? MessageType.System : MessageType.Default; - - this._update(data); - } - - /** Update details of this structure */ - _update(data: Partial | { deletedAt: string }): this { - if ("content" in data && typeof data.content !== "undefined") { - this.content = data.content; - } - - if ("mentions" in data) { - this.mentions = data.mentions; - } - - if ("updatedAt" in data) { - this._updatedAt = parseToStamp(data.updatedAt); - } - - if ("deletedAt" in data) { - this.deleted = true; - this._deletedAt = parseToStamp(data.deletedAt); - } - - if ("embeds" in data) { - this.embeds = data.embeds?.map((x) => new Embed(x)) ?? []; - } - - return this; - } - - get createdAt(): Date { - return new Date(this._createdAt); - } - - /** - * Returns the date and time the message was last updated, if relevant. - */ - get updatedAt(): Date | null { - return this._updatedAt ? new Date(this._updatedAt) : null; - } - - /** - * Returns the date and time the message was deleted, if it was. - */ - get deletedAt(): Date | null { - return this._deletedAt ? new Date(this._deletedAt) : null; - } - - /** Returns the url of this message */ - get url(): string { - if (!this.serverId) return ""; - return `https://www.guilded.gg/chat/${this.channelId}?messageId=${this.id}`; - } - - /** - * Returns the author of this message, or null if the author is not cached. - */ - get author(): User | null { - return this.client.users.cache.get(this.createdById) ?? null; - } - - /** - * Returns the ID of the user who sent this message. - */ - get authorId(): string { - return this.createdByWebhookId ?? this.createdById; - } - - /** - * Returns the member of this message, if the message is in a server, or null otherwise or if the member is not cached. - */ - get member(): Member | null { - return this.serverId ? this.client.members.cache.get(buildMemberKey(this.serverId, this.authorId)) ?? null : null; - } - - /** - * Returns the channel that this message belongs to, or null if the channel is not cached. - */ - get channel(): Channel | null { - return this.client.channels.cache.get(this.channelId) ?? null; - } - - get server(): Server | null { - return this.serverId ? this.client.servers.cache.get(this.serverId) ?? null : null; - } - - /** - * Edit message content. - * - * @param newContent - The new content of the message. - * @returns A promise that resolves with the updated message. - */ - async edit(newContent: MessageContent): Promise { - return this.client.messages.update(this.channelId, this.id, newContent); - } - - /** - * Send a message in the same channel as this message. - * - * @param content - The content of the message. - * @example - * let replyObj = { - * content: 'This is text, supports **markdown**.', - * embeds: [{ - * title: 'This is an embed title!', - * description: 'A description may go here' - * }] - * }; - * message.send(replyObj) - */ - send(content: MessageContent): Promise { - return this.client.messages.send(this.channelId, content); - } - - /** - * Send a message that replies to this message. It mentions the user who sent this message. - * - * @param content - The content of the message to send. - * @example - * let replyObj = { - * content: 'This is text, supports **markdown**.', - * embeds: [{ - * title: 'This is an embed title!', - * description: 'A description may go here' - * }] - * }; - * message.reply(replyObj) - */ - reply(content: MessageContent): Promise { - return this.client.messages.send(this.channelId, { - ...resolveContentToData(content), - replyMessageIds: [this.id], - }); - } - - createThread(name: string): Promise { - return this.client.channels.create({ - name, - messageId: this.id, - type: "chat", - }) as Promise; - } - - awaitReactions(options: CollectorOptions): Promise> { - return this.client.reactions.awaitReactions(this.id, options); - } - - /** - * Add a reaction emote. - * - * @param emoteId - The ID of the emote to add. - * @returns A promise that resolves when the emote has been added. - */ - async addReaction(emoteId: number): Promise { - return this.client.rest.router.reactions.channelMessageReactionCreate({ - channelId: this.channelId, - messageId: this.id, - emoteId, - }); - } - - /** - * Deletes either a whole reaction emote from a message or a specific user's if a userId is provided. - * - * @param emoteId - The ID of the emote to delete. - * @returns A promise that resolves when the emote has been deleted. - */ - deleteReaction(emoteId: number, userId?: string): Promise { - return this.client.rest.router.reactions.channelMessageReactionDelete({ - channelId: this.channelId, - messageId: this.id, - emoteId, - userId, - }); - } - - /** - * Delete this message. - * - * @returns A promise that resolves when the message has been deleted. - */ - delete(): Promise { - return this.client.messages.delete(this.channelId, this.id); - } + /** The ID of the group this message was posted in */ + readonly groupId: string | null; + + /** The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated. */ + readonly type: MessageType; + + /** The content of the message */ + content: string; + + /** The mentions within this message */ + mentions?: MentionsPayload; + + /** The ID of the messages that this is replying to. */ + readonly replyMessageIds: string[] = []; + + /** If set, this message will only be seen by those mentioned or replied to. */ + readonly isPrivate: boolean; + + /** If set, this message did not notify, mention or reply recipients. */ + readonly isSilent: boolean; + + /** The ID of the user who created this message (Note: If this event has createdByBotId or createdByWebhookId present, this field will still be populated, but can be ignored. In these cases, the value of this field will always be Ann6LewA) */ + readonly createdById: string; + + /** Bool value to wether message is a reply or not */ + readonly isReply: boolean; + + /** The ID of the webhook who created this message, if it was created by a webhook */ + readonly createdByWebhookId: string | null; + + /** The timestamp that the message was created at. */ + readonly _createdAt: number; + + /** The timestamp that the message was updated at, if relevant */ + _updatedAt: number | null; + + /** Whether the message has been deleted */ + deleted = false; + + /** When the message was deleted, if it was */ + _deletedAt: number | null = null; + + /** Embeds contained within this message */ + embeds: Embed[] = []; + + constructor(client: Client, data: ChatMessagePayload) { + super(client, data); + this.isReply = Boolean(data.replyMessageIds); + this.channelId = data.channelId; + this.groupId = data.groupId ?? null; + this.content = data.content ?? ""; + this.serverId = data.serverId ?? null; + this.replyMessageIds = data.replyMessageIds ?? []; + this.createdById = data.createdBy; + this.createdByWebhookId = data.createdByWebhookId ?? null; + this._createdAt = parseToStamp(data.createdAt)!; + this._updatedAt = null; + this.isPrivate = data.isPrivate ?? false; + this.isSilent = data.isSilent ?? false; + this.type = data.type === "system" ? MessageType.System : MessageType.Default; + + this._update(data); + } + + /** Update details of this structure */ + _update( + data: + | Partial + | { + deletedAt: string; + }, + ): this { + if ("content" in data && typeof data.content !== "undefined") { + this.content = data.content; + } + + if ("mentions" in data) { + this.mentions = data.mentions; + } + + if ("updatedAt" in data) { + this._updatedAt = parseToStamp(data.updatedAt); + } + + if ("deletedAt" in data) { + this.deleted = true; + this._deletedAt = parseToStamp(data.deletedAt); + } + + if ("embeds" in data) { + this.embeds = data.embeds?.map((x) => new Embed(x)) ?? []; + } + + return this; + } + + get createdAt(): Date { + return new Date(this._createdAt); + } + + /** + * Returns the date and time the message was last updated, if relevant. + */ + get updatedAt(): Date | null { + return this._updatedAt ? new Date(this._updatedAt) : null; + } + + /** + * Returns the date and time the message was deleted, if it was. + */ + get deletedAt(): Date | null { + return this._deletedAt ? new Date(this._deletedAt) : null; + } + + /** Returns the url of this message */ + get url(): string { + if (!this.serverId) return ""; + return `https://www.guilded.gg/chat/${this.channelId}?messageId=${this.id}`; + } + + /** + * Returns the author of this message, or null if the author is not cached. + */ + get author(): User | null { + return this.client.users.cache.get(this.createdById) ?? null; + } + + /** + * Returns the ID of the user who sent this message. + */ + get authorId(): string { + return this.createdByWebhookId ?? this.createdById; + } + + /** + * Returns the member of this message, if the message is in a server, or null otherwise or if the member is not cached. + */ + get member(): Member | null { + return this.serverId ? this.client.members.cache.get(buildMemberKey(this.serverId, this.authorId)) ?? null : null; + } + + /** + * Returns the channel that this message belongs to, or null if the channel is not cached. + */ + get channel(): Channel | null { + return this.client.channels.cache.get(this.channelId) ?? null; + } + + get server(): Server | null { + return this.serverId ? this.client.servers.cache.get(this.serverId) ?? null : null; + } + + /** + * Edit message content. + * + * @param newContent - The new content of the message. + * @returns A promise that resolves with the updated message. + */ + async edit(newContent: MessageContent): Promise { + return this.client.messages.update(this.channelId, this.id, newContent); + } + + /** + * Send a message in the same channel as this message. + * + * @param content - The content of the message. + * @example + * let replyObj = { + * content: 'This is text, supports **markdown**.', + * embeds: [{ + * title: 'This is an embed title!', + * description: 'A description may go here' + * }] + * }; + * message.send(replyObj) + */ + send(content: MessageContent): Promise { + return this.client.messages.send(this.channelId, content); + } + + /** + * Send a message that replies to this message. It mentions the user who sent this message. + * + * @param content - The content of the message to send. + * @example + * let replyObj = { + * content: 'This is text, supports **markdown**.', + * embeds: [{ + * title: 'This is an embed title!', + * description: 'A description may go here' + * }] + * }; + * message.reply(replyObj) + */ + reply(content: MessageContent): Promise { + return this.client.messages.send(this.channelId, { + ...resolveContentToData(content), + replyMessageIds: [this.id], + }); + } + + createThread(name: string): Promise { + return this.client.channels.create({ + name, + messageId: this.id, + type: "chat", + }) as Promise; + } + + awaitReactions(options: CollectorOptions): Promise> { + return this.client.reactions.awaitReactions(this.id, options); + } + + /** + * Add a reaction emote. + * + * @param emoteId - The ID of the emote to add. + * @returns A promise that resolves when the emote has been added. + */ + async addReaction(emoteId: number): Promise { + return this.client.rest.router.reactions.channelMessageReactionCreate({ + channelId: this.channelId, + messageId: this.id, + emoteId, + }); + } + + /** + * Deletes either a whole reaction emote from a message or a specific user's if a userId is provided. + * + * @param emoteId - The ID of the emote to delete. + * @returns A promise that resolves when the emote has been deleted. + */ + deleteReaction(emoteId: number, userId?: string): Promise { + return this.client.rest.router.reactions.channelMessageReactionDelete({ + channelId: this.channelId, + messageId: this.id, + emoteId, + userId, + }); + } + + /** + * Delete this message. + * + * @returns A promise that resolves when the message has been deleted. + */ + delete(): Promise { + return this.client.messages.delete(this.channelId, this.id); + } } /** * Represents a reaction to a message. */ export class MessageReaction extends Base { - /** - * The ID of the channel where the message was sent. - */ - readonly channelId: string; - - /** - * The ID of the message this reaction belongs to. - */ - readonly messageId: string; - - /** - * The ID of the user who created the reaction. - */ - readonly createdBy: string; - - /** - * The emote associated with this reaction. - */ - readonly emote: EmotePayload; - - /** - * The ID of the server where the reaction was made. - */ - readonly serverId: string; - - /** - * Creates a new instance of the MessageReaction class. - * - * @param client The client that instantiated this object. - * @param data The data representing the reaction. - */ - constructor(client: Client, data: FlattenedReactionData) { - const formedId = buildReactionKey(data.createdBy, data.emote.id); - super(client, { ...data, id: formedId }); - - this.id = formedId; - this.channelId = data.channelId; - this.messageId = data.messageId; - this.createdBy = data.createdBy; - this.emote = data.emote; - this.serverId = data.serverId; - } + /** + * The ID of the channel where the message was sent. + */ + readonly channelId: string; + + /** + * The ID of the message this reaction belongs to. + */ + readonly messageId: string; + + /** + * The ID of the user who created the reaction. + */ + readonly createdBy: string; + + /** + * The emote associated with this reaction. + */ + readonly emote: EmotePayload; + + /** + * The ID of the server where the reaction was made. + */ + readonly serverId: string; + + /** + * Creates a new instance of the MessageReaction class. + * + * @param client The client that instantiated this object. + * @param data The data representing the reaction. + */ + constructor(client: Client, data: FlattenedReactionData) { + const formedId = buildReactionKey(data.createdBy, data.emote.id); + super(client, { + ...data, + id: formedId, + }); + + this.id = formedId; + this.channelId = data.channelId; + this.messageId = data.messageId; + this.createdBy = data.createdBy; + this.emote = data.emote; + this.serverId = data.serverId; + } } type FlattenedReactionData = WSPayload<"ChannelMessageReactionCreated">["reaction"] & { - serverId: string; + serverId: string; }; diff --git a/packages/guilded.js/lib/structures/Role.ts b/packages/guilded.js/lib/structures/Role.ts index 88794336..4ec48dd8 100644 --- a/packages/guilded.js/lib/structures/Role.ts +++ b/packages/guilded.js/lib/structures/Role.ts @@ -7,112 +7,112 @@ import type { Client } from "./Client"; * Represents a Guilded role in a server */ export class Role extends Base<{ id: number; serverId: string }, number> { - /** The ID of the server this role belongs to */ - readonly serverId: string; - - /** The date this role was created */ - _createdAt: number; - - /** The date this role was last updated, if it was */ - _updatedAt: number | null; - - /** The name of this role */ - name: string; - - /** Whether this role is hoisted or not */ - isDisplayedSeparately: boolean; - - /** Whether this role is self assignable by members */ - isSelfAssignable: boolean; - - /** Whether this role is mentionable */ - isMentionable: boolean; - - /** The permissions this role has */ - permissions: string[]; - - /** The colors belonging to this role. If a solid color role, then there will be just one color in this array. Otherwise, the first color is the solid color, and second is a gradient. */ - colors: number[]; - - /** The URL of the role's icon */ - icon: string | null; - - /** The position of this role on the hierarchy */ - position: number; - - /** Whether this is the default role for members */ - isBase: boolean; - - /** The bot user ID this role has been defined for. */ - botUserId: string | null; - - /** - * @param client - The client instance - * @param data - The data for this role - */ - constructor(client: Client, data: RolePayload) { - super(client, data); - this.serverId = data.serverId; - this._createdAt = parseToStamp(data.createdAt)!; - this._updatedAt = null; - this.name = data.name; - this.isDisplayedSeparately = data.isDisplayedSeparately ?? false; - this.isSelfAssignable = data.isSelfAssignable ?? false; - this.isMentionable = data.isMentionable ?? false; - this.permissions = data.permissions; - this.colors = data.colors ?? []; - this.icon = data.icon ?? null; - this.position = data.position; - this.isBase = data.isBase ?? false; - this.botUserId = data.botUserId ?? null; - } - - _update(data: RolePayload): this { - if ("updatedAt" in data) { - this._updatedAt = data.updatedAt ? parseToStamp(data.updatedAt) : null; - } - - return this; - } - - get createdAt(): Date { - return new Date(this._createdAt); - } - - /** - * Returns the date and time the message was last updated, if relevant. - */ - get updatedAt(): Date | null { - return this._updatedAt ? new Date(this._updatedAt) : null; - } - - /** - * Award XP to a role - * - * @param amount - The amount of XP to award to the role - * @returns A Promise that resolves to the new total XP of the role - */ - giveXP(amount: number): Promise { - return this.client.roles.giveXP(this.serverId, this.id, amount); - } - - /** - * Assign role to member - * - * @param memberId - The ID of the member to assign the role to - * @returns A Promise that resolves when the role has been assigned to the member - */ - assignToMember(memberId: string): Promise { - return this.client.roles.addRoleToMember(this.serverId, memberId, this.id); - } - - /** - * Remove role from member - * - * @param memberId - The ID of the member to remove the role from - * @returns A Promise that resolves when the role has been removed from the member - */ - removeFromMember(memberId: string): Promise { - return this.client.roles.removeRoleFromMember(this.serverId, memberId, this.id); - } + /** The ID of the server this role belongs to */ + readonly serverId: string; + + /** The date this role was created */ + _createdAt: number; + + /** The date this role was last updated, if it was */ + _updatedAt: number | null; + + /** The name of this role */ + name: string; + + /** Whether this role is hoisted or not */ + isDisplayedSeparately: boolean; + + /** Whether this role is self assignable by members */ + isSelfAssignable: boolean; + + /** Whether this role is mentionable */ + isMentionable: boolean; + + /** The permissions this role has */ + permissions: string[]; + + /** The colors belonging to this role. If a solid color role, then there will be just one color in this array. Otherwise, the first color is the solid color, and second is a gradient. */ + colors: number[]; + + /** The URL of the role's icon */ + icon: string | null; + + /** The position of this role on the hierarchy */ + position: number; + + /** Whether this is the default role for members */ + isBase: boolean; + + /** The bot user ID this role has been defined for. */ + botUserId: string | null; + + /** + * @param client - The client instance + * @param data - The data for this role + */ + constructor(client: Client, data: RolePayload) { + super(client, data); + this.serverId = data.serverId; + this._createdAt = parseToStamp(data.createdAt)!; + this._updatedAt = null; + this.name = data.name; + this.isDisplayedSeparately = data.isDisplayedSeparately ?? false; + this.isSelfAssignable = data.isSelfAssignable ?? false; + this.isMentionable = data.isMentionable ?? false; + this.permissions = data.permissions; + this.colors = data.colors ?? []; + this.icon = data.icon ?? null; + this.position = data.position; + this.isBase = data.isBase ?? false; + this.botUserId = data.botUserId ?? null; + } + + _update(data: RolePayload): this { + if ("updatedAt" in data) { + this._updatedAt = data.updatedAt ? parseToStamp(data.updatedAt) : null; + } + + return this; + } + + get createdAt(): Date { + return new Date(this._createdAt); + } + + /** + * Returns the date and time the message was last updated, if relevant. + */ + get updatedAt(): Date | null { + return this._updatedAt ? new Date(this._updatedAt) : null; + } + + /** + * Award XP to a role + * + * @param amount - The amount of XP to award to the role + * @returns A Promise that resolves to the new total XP of the role + */ + giveXP(amount: number): Promise { + return this.client.roles.giveXP(this.serverId, this.id, amount); + } + + /** + * Assign role to member + * + * @param memberId - The ID of the member to assign the role to + * @returns A Promise that resolves when the role has been assigned to the member + */ + assignToMember(memberId: string): Promise { + return this.client.roles.addRoleToMember(this.serverId, memberId, this.id); + } + + /** + * Remove role from member + * + * @param memberId - The ID of the member to remove the role from + * @returns A Promise that resolves when the role has been removed from the member + */ + removeFromMember(memberId: string): Promise { + return this.client.roles.removeRoleFromMember(this.serverId, memberId, this.id); + } } diff --git a/packages/guilded.js/lib/structures/Server.ts b/packages/guilded.js/lib/structures/Server.ts index 7ef9d4c7..a7eff85d 100644 --- a/packages/guilded.js/lib/structures/Server.ts +++ b/packages/guilded.js/lib/structures/Server.ts @@ -9,127 +9,127 @@ import type { Channel } from "./channels"; * A class representing a Guilded server. */ export class Server extends Base { - /** The ID of the owner of this server */ - ownerId: string; + /** The ID of the owner of this server */ + ownerId: string; - /** The type of this server */ - type!: ServerType | null; + /** The type of this server */ + type!: ServerType | null; - /** The name of this server */ - name!: string; + /** The name of this server */ + name!: string; - /** The slug of the URL this server is accessible from */ - shortURL!: string; + /** The slug of the URL this server is accessible from */ + shortURL!: string; - /** The description of this server */ - description!: string | null; + /** The description of this server */ + description!: string | null; - /** The icon of this server */ - iconURL!: string | null; + /** The icon of this server */ + iconURL!: string | null; - /** The banner of this server */ - bannerURL!: string | null; + /** The banner of this server */ + bannerURL!: string | null; - /** The timezone this server is in */ - timezone!: string | null; + /** The timezone this server is in */ + timezone!: string | null; - /** Whether this server is verified or not */ - isVerified!: boolean; + /** Whether this server is verified or not */ + isVerified!: boolean; - /** The default channel of this server */ - defaultChannelId!: string; + /** The default channel of this server */ + defaultChannelId!: string; - /** The date this server was created */ - _createdAt!: number; + /** The date this server was created */ + _createdAt!: number; - constructor(client: Client, data: ServerPayload) { - super(client, data); - this.ownerId = data.ownerId; - this._createdAt = parseToStamp(data.createdAt)!; - this._update(data); - } + constructor(client: Client, data: ServerPayload) { + super(client, data); + this.ownerId = data.ownerId; + this._createdAt = parseToStamp(data.createdAt)!; + this._update(data); + } - /** The date when the server was created. */ - get createdAt(): Date { - return new Date(this._createdAt); - } + /** The date when the server was created. */ + get createdAt(): Date { + return new Date(this._createdAt); + } - /** The URL of the server. */ - get url(): string { - return `https://www.guilded.gg/${this.shortURL}`; - } + /** The URL of the server. */ + get url(): string { + return `https://www.guilded.gg/${this.shortURL}`; + } - /** The owner of the server. */ - get owner(): Member | null { - return this.client.members.cache.get(buildMemberKey(this.id, this.ownerId)) ?? null; - } + /** The owner of the server. */ + get owner(): Member | null { + return this.client.members.cache.get(buildMemberKey(this.id, this.ownerId)) ?? null; + } - /** The default channel of the server. */ - get defaultChannel(): Channel | null { - return this.defaultChannelId ? this.client.channels.cache.get(this.defaultChannelId) ?? null : null; - } + /** The default channel of the server. */ + get defaultChannel(): Channel | null { + return this.defaultChannelId ? this.client.channels.cache.get(this.defaultChannelId) ?? null : null; + } - _update(data: Partial): this { - if ("name" in data && typeof data.name !== "undefined") { - this.name = data.name; - } + _update(data: Partial): this { + if ("name" in data && typeof data.name !== "undefined") { + this.name = data.name; + } - if ("type" in data && typeof data.type !== "undefined") { - this.type = ServerTypeMap[data.type] ?? null; - } + if ("type" in data && typeof data.type !== "undefined") { + this.type = ServerTypeMap[data.type] ?? null; + } - if ("url" in data && typeof data.url !== "undefined") { - this.shortURL = data.url ?? null; - } + if ("url" in data && typeof data.url !== "undefined") { + this.shortURL = data.url ?? null; + } - if ("about" in data && typeof data.about !== "undefined") { - this.description = data.about ?? null; - } + if ("about" in data && typeof data.about !== "undefined") { + this.description = data.about ?? null; + } - if ("avatar" in data && typeof data.avatar !== "undefined") { - this.iconURL = data.avatar ?? null; - } + if ("avatar" in data && typeof data.avatar !== "undefined") { + this.iconURL = data.avatar ?? null; + } - if ("bannerURL" in data && typeof data.banner !== "undefined") { - this.bannerURL = data.banner ?? null; - } + if ("bannerURL" in data && typeof data.banner !== "undefined") { + this.bannerURL = data.banner ?? null; + } - if ("timezone" in data && typeof data.timezone !== "undefined") { - this.timezone = data.timezone ?? null; - } + if ("timezone" in data && typeof data.timezone !== "undefined") { + this.timezone = data.timezone ?? null; + } - if ("isVerified" in data && typeof data.isVerified !== "undefined") { - this.isVerified = data.isVerified ?? false; - } + if ("isVerified" in data && typeof data.isVerified !== "undefined") { + this.isVerified = data.isVerified ?? false; + } - if ("defaultChannelId" in data && typeof data.defaultChannelId !== "undefined") { - this.defaultChannelId = data.defaultChannelId ?? null; - } + if ("defaultChannelId" in data && typeof data.defaultChannelId !== "undefined") { + this.defaultChannelId = data.defaultChannelId ?? null; + } - return this; - } + return this; + } } /** The type of a Guilded server. */ export enum ServerType { - Team, - Organization, - Community, - Clan, - Guild, - Friends, - Streaming, - Other, + Team = 0, + Organization = 1, + Community = 2, + Clan = 3, + Guild = 4, + Friends = 5, + Streaming = 6, + Other = 7, } /** A mapping of server types from the API to the client. */ export const ServerTypeMap: Record, ServerType> = { - team: ServerType.Team, - organization: ServerType.Organization, - community: ServerType.Community, - clan: ServerType.Clan, - guild: ServerType.Guild, - friends: ServerType.Friends, - streaming: ServerType.Streaming, - other: ServerType.Other, + team: ServerType.Team, + organization: ServerType.Organization, + community: ServerType.Community, + clan: ServerType.Clan, + guild: ServerType.Guild, + friends: ServerType.Friends, + streaming: ServerType.Streaming, + other: ServerType.Other, }; diff --git a/packages/guilded.js/lib/structures/Subscription.ts b/packages/guilded.js/lib/structures/Subscription.ts index 4dafff82..0d71ef64 100644 --- a/packages/guilded.js/lib/structures/Subscription.ts +++ b/packages/guilded.js/lib/structures/Subscription.ts @@ -12,39 +12,42 @@ export type ServerSubscriptionTierType = "Copper" | "Gold" | "Silver"; * Represents a Guilded SubscriptionTier in a server. */ export class ServerSubscriptionTier extends Base { - /** The ID of the server */ - readonly serverId: string; - - /** The ISO 8601 timestamp that the server subscription tier was created at */ - _createdAt: number; - - /** The type of the server subscription tier. This field is case sensitive!! */ - type: ServerSubscriptionTierType; - - /** The description associated with the server subscription tier (max length 256) */ - description: string | null; - - /** The ID of the role */ - roleId: number | null; - - /** The cost of the tier in cents USD per month (min 200; max 10000) */ - cost: number; - - /** - * @param client The client instance - * @param data The data for this role - */ - constructor(client: Client, data: ServerSubscriptionTierPayload) { - super(client, { id: data.type, ...data }); - this.serverId = data.serverId; - this._createdAt = parseToStamp(data.createdAt)!; - this.description = data.description ?? null; - this.roleId = data.roleId ?? null; - this.cost = data.cost; - this.type = data.type; - } - - get createdAt(): Date { - return new Date(this._createdAt); - } + /** The ID of the server */ + readonly serverId: string; + + /** The ISO 8601 timestamp that the server subscription tier was created at */ + _createdAt: number; + + /** The type of the server subscription tier. This field is case sensitive!! */ + type: ServerSubscriptionTierType; + + /** The description associated with the server subscription tier (max length 256) */ + description: string | null; + + /** The ID of the role */ + roleId: number | null; + + /** The cost of the tier in cents USD per month (min 200; max 10000) */ + cost: number; + + /** + * @param client The client instance + * @param data The data for this role + */ + constructor(client: Client, data: ServerSubscriptionTierPayload) { + super(client, { + id: data.type, + ...data, + }); + this.serverId = data.serverId; + this._createdAt = parseToStamp(data.createdAt)!; + this.description = data.description ?? null; + this.roleId = data.roleId ?? null; + this.cost = data.cost; + this.type = data.type; + } + + get createdAt(): Date { + return new Date(this._createdAt); + } } diff --git a/packages/guilded.js/lib/structures/User.ts b/packages/guilded.js/lib/structures/User.ts index 2ef901bc..1c52023b 100644 --- a/packages/guilded.js/lib/structures/User.ts +++ b/packages/guilded.js/lib/structures/User.ts @@ -4,72 +4,75 @@ import { Base } from "./Base"; import type { Client } from "./Client"; export class User extends Base { - /** The name for this user */ - name: string; + /** The name for this user */ + name: string; - /** The type of this user */ - readonly type: UserType; + /** The type of this user */ + readonly type: UserType; - /** The avatar image associated with this user */ - avatar: string | null = null; + /** The avatar image associated with this user */ + avatar: string | null = null; - /** The banner image associated with this user */ - banner: string | null = null; + /** The banner image associated with this user */ + banner: string | null = null; - /** When this user was created */ - readonly _createdAt: number | null; + /** When this user was created */ + readonly _createdAt: number | null; - constructor(client: Client, data: UserPayload) { - super(client, data); - this.name = data.name; - this._createdAt = parseToStamp(data.createdAt)!; - this.type = data.type === "bot" ? UserType.Bot : UserType.User; + constructor(client: Client, data: UserPayload) { + super(client, data); + this.name = data.name; + this._createdAt = parseToStamp(data.createdAt)!; + this.type = data.type === "bot" ? UserType.Bot : UserType.User; - this._update(data); - } + this._update(data); + } - get createdAt(): Date | null { - return this._createdAt ? new Date(this._createdAt) : null; - } + get createdAt(): Date | null { + return this._createdAt ? new Date(this._createdAt) : null; + } - _update(data: Partial): this { - if ("avatar" in data) { - this.avatar = data.avatar ?? null; - } + _update(data: Partial): this { + if ("avatar" in data) { + this.avatar = data.avatar ?? null; + } - if ("banner" in data) { - this.banner = data.banner ?? null; - } + if ("banner" in data) { + this.banner = data.banner ?? null; + } - return this; - } + return this; + } } export class ClientUser extends User { - // User who has created this bot - readonly createdBy: string; - - // The bot ID (not to be confused with the user ID) of this bot - readonly botId: string; - - constructor( - client: Client, - data: WSPayload<"_WelcomeMessage">["user"] & { - createdBy: string; - botId: string; - }, - ) { - super(client, { ...data, type: "bot" }); - this.createdBy = data.createdBy; - this.botId = data.botId; - } - - fetch(): Promise { - return this.client.users.fetchClient(); - } + // User who has created this bot + readonly createdBy: string; + + // The bot ID (not to be confused with the user ID) of this bot + readonly botId: string; + + constructor( + client: Client, + data: WSPayload<"_WelcomeMessage">["user"] & { + createdBy: string; + botId: string; + }, + ) { + super(client, { + ...data, + type: "bot", + }); + this.createdBy = data.createdBy; + this.botId = data.botId; + } + + fetch(): Promise { + return this.client.users.fetchClient(); + } } export enum UserType { - Bot, - User, + Bot = 0, + User = 1, } diff --git a/packages/guilded.js/lib/structures/Webhook.ts b/packages/guilded.js/lib/structures/Webhook.ts index 8ac8c38c..27b589cb 100644 --- a/packages/guilded.js/lib/structures/Webhook.ts +++ b/packages/guilded.js/lib/structures/Webhook.ts @@ -9,104 +9,104 @@ import type { User } from "./User"; * Object representing received webhook data. This object is NOT to be used to send data to webhooks. That would be WebhookClient */ export class Webhook extends Base { - /** - * The username belonging to this webhook - */ - name!: string; + /** + * The username belonging to this webhook + */ + name!: string; - /** - * The ID of the channel this webhook belongs to - */ - channelID!: string; + /** + * The ID of the channel this webhook belongs to + */ + channelID!: string; - /** - * The ID of the server this webhook belongs to - */ - readonly serverId: string; + /** + * The ID of the server this webhook belongs to + */ + readonly serverId: string; - /** - * The date in which this webhook was created - */ - _createdAt: number; + /** + * The date in which this webhook was created + */ + _createdAt: number; - /** - * The date this webhook was deleted if it was deleted - */ - _deletedAt: number | null = null; + /** + * The date this webhook was deleted if it was deleted + */ + _deletedAt: number | null = null; - /** - * The user who created this webhook - */ - readonly authorID: string; + /** + * The user who created this webhook + */ + readonly authorID: string; - /** - * The token of this webhook - */ - token!: string | null; + /** + * The token of this webhook + */ + token!: string | null; - constructor(client: Client, data: WebhookPayload) { - super(client, data); - this.serverId = data.serverId; - this._createdAt = parseToStamp(data.createdAt)!; - this.authorID = data.createdBy; - this._update(data); - } + constructor(client: Client, data: WebhookPayload) { + super(client, data); + this.serverId = data.serverId; + this._createdAt = parseToStamp(data.createdAt)!; + this.authorID = data.createdBy; + this._update(data); + } - /** - * Returns the creation date of this webhook - * - * @returns The creation date of this webhook - */ - get createdAt(): Date { - return new Date(this._createdAt); - } + /** + * Returns the creation date of this webhook + * + * @returns The creation date of this webhook + */ + get createdAt(): Date { + return new Date(this._createdAt); + } - /** - * Returns the deletion date of this webhook if it was deleted - * - * @returns The deletion date of this webhook if it was deleted, otherwise null - */ - get deletedAt(): Date | null { - return this._deletedAt ? new Date(this._deletedAt) : null; - } + /** + * Returns the deletion date of this webhook if it was deleted + * + * @returns The deletion date of this webhook if it was deleted, otherwise null + */ + get deletedAt(): Date | null { + return this._deletedAt ? new Date(this._deletedAt) : null; + } - /** - * Returns the author of this webhook - * - * @returns The author of this webhook, or null if the author is not cached - */ - get user(): User | null { - return this.client.users.cache.get(this.id) ?? null; - } + /** + * Returns the author of this webhook + * + * @returns The author of this webhook, or null if the author is not cached + */ + get user(): User | null { + return this.client.users.cache.get(this.id) ?? null; + } - /** - * Updates this webhook with new options - * - * @param options The new options for this webhook - * @returns A promise that resolves with the updated webhook - */ - update(options: Parameters[2]): Promise { - return this.client.webhooks.update(this.serverId, this.id, options); - } + /** + * Updates this webhook with new options + * + * @param options The new options for this webhook + * @returns A promise that resolves with the updated webhook + */ + update(options: Parameters[2]): Promise { + return this.client.webhooks.update(this.serverId, this.id, options); + } - /** - * Deletes this webhook - * - * @returns A promise that resolves with this webhook after it has been deleted - */ - async delete(): Promise { - await this.client.webhooks.delete(this.serverId, this.id); - return this; - } + /** + * Deletes this webhook + * + * @returns A promise that resolves with this webhook after it has been deleted + */ + async delete(): Promise { + await this.client.webhooks.delete(this.serverId, this.id); + return this; + } - _update(data: Partial): this { - if ("name" in data && data.name !== undefined) this.name = data.name; - if ("channelId" in data && data.channelId !== undefined) this.channelID = data.channelId; - if ("token" in data && data.token !== undefined) this.token = data.token ?? null; - if ("deletedAt" in data && data.deletedAt !== undefined) { - this._deletedAt = data.deletedAt ? parseToStamp(data.deletedAt) : null; - } + _update(data: Partial): this { + if ("name" in data && data.name !== undefined) this.name = data.name; + if ("channelId" in data && data.channelId !== undefined) this.channelID = data.channelId; + if ("token" in data && data.token !== undefined) this.token = data.token ?? null; + if ("deletedAt" in data && data.deletedAt !== undefined) { + this._deletedAt = data.deletedAt ? parseToStamp(data.deletedAt) : null; + } - return this; - } + return this; + } } diff --git a/packages/guilded.js/lib/structures/channels/Channel.ts b/packages/guilded.js/lib/structures/channels/Channel.ts index 8d7e7e88..6ec7f7e3 100644 --- a/packages/guilded.js/lib/structures/channels/Channel.ts +++ b/packages/guilded.js/lib/structures/channels/Channel.ts @@ -10,220 +10,231 @@ import type { Message } from "../Message"; * Represents a channel in a server on Guilded. */ export class Channel extends Base { - /** - * The type of the channel. - */ - type: ChannelType; - - /** - * The name of the channel. - */ - name!: string; - - /** - * The topic of the channel. - */ - topic!: string | null; - - /** - * The timestamp when the channel was created. - */ - _createdAt: number; - - /** - * The user ID of the user who created the channel. - */ - createdBy: string; - - /** - * The timestamp when the channel was last updated. - */ - _updatedAt!: number | null; - - /** - * The ID of the server that the channel belongs to. - */ - serverId: string; - - /** - * The ID of the parent channel. - */ - parentId!: string | null; - - /** - * The ID of the category that the channel belongs to. - */ - categoryId!: number | null; - - /** - * The ID of the group that the channel belongs to. - */ - groupId: string; - - /** - * Whether the channel is public. - */ - isPublic!: boolean; - - /** - * The user ID of the user who archived the channel. - */ - archivedBy!: string | null; - - /** - * The timestamp when the channel was archived. - */ - _archivedAt!: number | null; - - constructor(client: Client, data: ServerChannelPayload & { deleted?: boolean }) { - super(client, data); - this.serverId = data.serverId; - this.type = channelTypeToEnumMap[data.type]; - this._createdAt = parseToStamp(data.createdAt)!; - this.createdBy = data.createdBy; - this.groupId = data.groupId; - - this._update(data); - } - - /** - * The timestamp when the channel was created as a Date object. - */ - get createdAt(): Date { - return new Date(this._createdAt); - } - - /** - * The timestamp when the channel was archived as a Date object, or null if the channel is not archived. - */ - get archivedAt(): Date | null { - return this._archivedAt ? new Date(this._archivedAt) : null; - } - - /** - * The timestamp when the channel was last updated as a Date object, or null if the channel has not been updated. - */ - get updatedAt(): Date | null { - return this._updatedAt ? new Date(this._updatedAt) : null; - } - - _update(data: Partial): this { - if ("name" in data && typeof data.name !== "undefined") { - this.name = data.name; - } - - if ("topic" in data) { - this.topic = data.topic ?? null; - } - - if ("updatedAt" in data && typeof data.updatedAt !== "undefined") { - this._updatedAt = data.updatedAt ? parseToStamp(data.updatedAt) : null; - } - - if ("parentId" in data && typeof data.updatedAt !== "undefined") { - this.parentId = data.parentId ?? null; - } - - if ("categoryId" in data && typeof data.categoryId !== "undefined") { - this.categoryId = data.categoryId ?? null; - } - - if ("isPublic" in data && typeof data.isPublic !== "undefined") { - this.isPublic = data.isPublic ?? false; - } - - if ("archivedBy" in data && typeof data.archivedBy !== "undefined") { - this.archivedBy = data.archivedBy ?? null; - } - - if ("archivedAt" in data && typeof data.archivedAt !== "undefined") { - this._archivedAt = data.archivedAt ? parseToStamp(data.archivedAt) : null; - } - - return this; - } - - /** - * Fetch from the latest 100 messages in the channel. - * - * @param options - Additional options for the message fetch. - */ - fetchMessages(options?: OptionBody): Promise> { - return this.client.messages.fetchMany(this.id, options ?? {}); - } - - /** - * Fetch details for a specific message in the channel. - * - * @param messageId - The ID of the message to fetch. - */ - fetchMessage(messageId: string): Promise { - return this.client.messages.fetch(this.id, messageId); - } - - /** - * Update the channel with new data. - * - * @param options - The new data for the channel. - */ - update(options: OptionBody): Promise { - return this.client.channels.update(this.id, options); - } - - /** - * Delete the channel. - */ - delete(): Promise { - return this.client.channels.delete(this.id); - } - - /** - * Send a message in the channel. - * - * @param content - The content of the message. - * @example - * let replyObj = { - * content: 'This is text, supports **markdown**.', - * embeds: [{ - * title: 'This is an embed title!', - * description: 'A description may go here' - * }] - * }; - * channel.send(replyObj) - */ - send(content: MessageContent): Promise { - return this.client.messages.send(this.id, content); - } + /** + * The type of the channel. + */ + type: ChannelType; + + /** + * The name of the channel. + */ + name!: string; + + /** + * The topic of the channel. + */ + topic!: string | null; + + /** + * The timestamp when the channel was created. + */ + _createdAt: number; + + /** + * The user ID of the user who created the channel. + */ + createdBy: string; + + /** + * The timestamp when the channel was last updated. + */ + _updatedAt!: number | null; + + /** + * The ID of the server that the channel belongs to. + */ + serverId: string; + + /** + * The ID of the parent channel. + */ + parentId!: string | null; + + /** + * The ID of the category that the channel belongs to. + */ + categoryId!: number | null; + + /** + * The ID of the group that the channel belongs to. + */ + groupId: string; + + /** + * Whether the channel is public. + */ + isPublic!: boolean; + + /** + * The user ID of the user who archived the channel. + */ + archivedBy!: string | null; + + /** + * The timestamp when the channel was archived. + */ + _archivedAt!: number | null; + + constructor( + client: Client, + data: ServerChannelPayload & { + deleted?: boolean; + }, + ) { + super(client, data); + this.serverId = data.serverId; + this.type = channelTypeToEnumMap[data.type]; + this._createdAt = parseToStamp(data.createdAt)!; + this.createdBy = data.createdBy; + this.groupId = data.groupId; + + this._update(data); + } + + /** + * The timestamp when the channel was created as a Date object. + */ + get createdAt(): Date { + return new Date(this._createdAt); + } + + /** + * The timestamp when the channel was archived as a Date object, or null if the channel is not archived. + */ + get archivedAt(): Date | null { + return this._archivedAt ? new Date(this._archivedAt) : null; + } + + /** + * The timestamp when the channel was last updated as a Date object, or null if the channel has not been updated. + */ + get updatedAt(): Date | null { + return this._updatedAt ? new Date(this._updatedAt) : null; + } + + _update( + data: Partial< + ServerChannelPayload & { + deleted?: boolean; + } + >, + ): this { + if ("name" in data && typeof data.name !== "undefined") { + this.name = data.name; + } + + if ("topic" in data) { + this.topic = data.topic ?? null; + } + + if ("updatedAt" in data && typeof data.updatedAt !== "undefined") { + this._updatedAt = data.updatedAt ? parseToStamp(data.updatedAt) : null; + } + + if ("parentId" in data && typeof data.updatedAt !== "undefined") { + this.parentId = data.parentId ?? null; + } + + if ("categoryId" in data && typeof data.categoryId !== "undefined") { + this.categoryId = data.categoryId ?? null; + } + + if ("isPublic" in data && typeof data.isPublic !== "undefined") { + this.isPublic = data.isPublic ?? false; + } + + if ("archivedBy" in data && typeof data.archivedBy !== "undefined") { + this.archivedBy = data.archivedBy ?? null; + } + + if ("archivedAt" in data && typeof data.archivedAt !== "undefined") { + this._archivedAt = data.archivedAt ? parseToStamp(data.archivedAt) : null; + } + + return this; + } + + /** + * Fetch from the latest 100 messages in the channel. + * + * @param options - Additional options for the message fetch. + */ + fetchMessages(options?: OptionBody): Promise> { + return this.client.messages.fetchMany(this.id, options ?? {}); + } + + /** + * Fetch details for a specific message in the channel. + * + * @param messageId - The ID of the message to fetch. + */ + fetchMessage(messageId: string): Promise { + return this.client.messages.fetch(this.id, messageId); + } + + /** + * Update the channel with new data. + * + * @param options - The new data for the channel. + */ + update(options: OptionBody): Promise { + return this.client.channels.update(this.id, options); + } + + /** + * Delete the channel. + */ + delete(): Promise { + return this.client.channels.delete(this.id); + } + + /** + * Send a message in the channel. + * + * @param content - The content of the message. + * @example + * let replyObj = { + * content: 'This is text, supports **markdown**.', + * embeds: [{ + * title: 'This is an embed title!', + * description: 'A description may go here' + * }] + * }; + * channel.send(replyObj) + */ + send(content: MessageContent): Promise { + return this.client.messages.send(this.id, content); + } } /** * Enum for mapping channel types to an int for memory saving. */ export enum ChannelType { - Announcements, - Chat, - Calendar, - Forums, - Media, - Docs, - Voice, - List, - Scheduling, - Stream, + Announcements = 0, + Chat = 1, + Calendar = 2, + Forums = 3, + Media = 4, + Docs = 5, + Voice = 6, + List = 7, + Scheduling = 8, + Stream = 9, } /** * A map of API channel types to channel types. */ export const channelTypeToEnumMap: Record = { - announcements: ChannelType.Announcements, - chat: ChannelType.Chat, - calendar: ChannelType.Calendar, - forums: ChannelType.Forums, - media: ChannelType.Media, - docs: ChannelType.Docs, - voice: ChannelType.Voice, - list: ChannelType.List, - scheduling: ChannelType.Scheduling, - stream: ChannelType.Stream, + announcements: ChannelType.Announcements, + chat: ChannelType.Chat, + calendar: ChannelType.Calendar, + forums: ChannelType.Forums, + media: ChannelType.Media, + docs: ChannelType.Docs, + voice: ChannelType.Voice, + list: ChannelType.List, + scheduling: ChannelType.Scheduling, + stream: ChannelType.Stream, }; diff --git a/packages/guilded.js/lib/structures/channels/ChatChannel.ts b/packages/guilded.js/lib/structures/channels/ChatChannel.ts index 077a33d0..701b362c 100644 --- a/packages/guilded.js/lib/structures/channels/ChatChannel.ts +++ b/packages/guilded.js/lib/structures/channels/ChatChannel.ts @@ -9,13 +9,13 @@ import { Channel } from "./Channel"; * @extends Channel */ export class ChatChannel extends Channel { - /** - * Create a new webhook for this channel. - * - * @param options - The options for creating the webhook. - * @returns A promise that resolves with the created webhook. - */ - createWebhook(options: OptionBody): Promise { - return this.client.webhooks.create(this.serverId, options); - } + /** + * Create a new webhook for this channel. + * + * @param options - The options for creating the webhook. + * @returns A promise that resolves with the created webhook. + */ + createWebhook(options: OptionBody): Promise { + return this.client.webhooks.create(this.serverId, options); + } } diff --git a/packages/guilded.js/lib/structures/channels/DocChannel.ts b/packages/guilded.js/lib/structures/channels/DocChannel.ts index c2f4ad16..60f12223 100644 --- a/packages/guilded.js/lib/structures/channels/DocChannel.ts +++ b/packages/guilded.js/lib/structures/channels/DocChannel.ts @@ -9,58 +9,58 @@ import { Channel } from "./Channel"; * @extends Channel */ export class DocChannel extends Channel { - /** - * The docs in this channel. - */ - readonly docs = new Collection(); + /** + * The docs in this channel. + */ + readonly docs = new Collection(); - /** - * Create a new doc in this channel. - * - * @param options - The options for creating the doc. - * @returns A promise that resolves with the created doc. - */ - createDoc(options: OptionBody): Promise { - return this.client.docs.create(this.id, options); - } + /** + * Create a new doc in this channel. + * + * @param options - The options for creating the doc. + * @returns A promise that resolves with the created doc. + */ + createDoc(options: OptionBody): Promise { + return this.client.docs.create(this.id, options); + } - /** - * Get all the docs from this channel. - * - * @returns A promise that resolves with an array of all docs. - */ - getDocs(): Promise { - return this.client.docs.fetchMany(this.id); - } + /** + * Get all the docs from this channel. + * + * @returns A promise that resolves with an array of all docs. + */ + getDocs(): Promise { + return this.client.docs.fetchMany(this.id); + } - /** - * Get a specific doc from this channel. - * - * @param docId - The ID ofDocPayload the doc to fetch. - * @returns A promise that resolves with the fetched doc. - */ - getDoc(docId: number): Promise { - return this.client.docs.fetch(this.id, docId); - } + /** + * Get a specific doc from this channel. + * + * @param docId - The ID ofDocPayload the doc to fetch. + * @returns A promise that resolves with the fetched doc. + */ + getDoc(docId: number): Promise { + return this.client.docs.fetch(this.id, docId); + } - /** - * Update a specific doc in this channel. - * - * @param docId - The ID of the doc to update. - * @param options - The options for updating the doc. - * @returns A promise that resolves with the updated doc. - */ - updateDoc(docId: number, options: OptionBody): Promise { - return this.client.docs.update(this.id, docId, options); - } + /** + * Update a specific doc in this channel. + * + * @param docId - The ID of the doc to update. + * @param options - The options for updating the doc. + * @returns A promise that resolves with the updated doc. + */ + updateDoc(docId: number, options: OptionBody): Promise { + return this.client.docs.update(this.id, docId, options); + } - /** - * Delete a specific doc from this channel. - * - * @param docId - The ID of the doc to delete. - * @returns A promise that resolves with no data. - */ - deleteDoc(docId: number): Promise { - return this.client.docs.delete(this.id, docId); - } + /** + * Delete a specific doc from this channel. + * + * @param docId - The ID of the doc to delete. + * @returns A promise that resolves with no data. + */ + deleteDoc(docId: number): Promise { + return this.client.docs.delete(this.id, docId); + } } diff --git a/packages/guilded.js/lib/structures/channels/ForumChannel.ts b/packages/guilded.js/lib/structures/channels/ForumChannel.ts index 93235146..aef9fb09 100644 --- a/packages/guilded.js/lib/structures/channels/ForumChannel.ts +++ b/packages/guilded.js/lib/structures/channels/ForumChannel.ts @@ -9,27 +9,30 @@ import { Channel } from "./Channel"; * @extends Channel */ export class ForumChannel extends Channel { - /** The topics in this channel. */ - readonly topics = new Collection(); + /** The topics in this channel. */ + readonly topics = new Collection(); - /** - * Creates a topic in this forum channel. - * - * @param title - The title of the new topic. - * @param content - The content of the new topic. - * @returns A Promise that resolves with the newly created topic payload. - */ - createTopic(title: string, content: string): Promise { - return this.client.topics.create(this.id, { title, content }); - } + /** + * Creates a topic in this forum channel. + * + * @param title - The title of the new topic. + * @param content - The content of the new topic. + * @returns A Promise that resolves with the newly created topic payload. + */ + createTopic(title: string, content: string): Promise { + return this.client.topics.create(this.id, { + title, + content, + }); + } - /** - * Deletes a topic from this forum channel. - * - * @param forumTopicId - The ID of the topic to delete. - * @returns A Promise that resolves when the topic is deleted. - */ - deleteTopic(forumTopicId: number): Promise { - return this.client.topics.delete(this.id, forumTopicId); - } + /** + * Deletes a topic from this forum channel. + * + * @param forumTopicId - The ID of the topic to delete. + * @returns A Promise that resolves when the topic is deleted. + */ + deleteTopic(forumTopicId: number): Promise { + return this.client.topics.delete(this.id, forumTopicId); + } } diff --git a/packages/guilded.js/lib/structures/channels/ListChannel.ts b/packages/guilded.js/lib/structures/channels/ListChannel.ts index 8c33ae6f..07ab4c73 100644 --- a/packages/guilded.js/lib/structures/channels/ListChannel.ts +++ b/packages/guilded.js/lib/structures/channels/ListChannel.ts @@ -8,68 +8,72 @@ import { Channel } from "./Channel"; * @extends Channel */ export class ListChannel extends Channel { - /** - * The list items in this channel. - */ - readonly items = new Collection(); + /** + * The list items in this channel. + */ + readonly items = new Collection(); - /** - * Creates a list item in this channel. - * - * @param message - The message of the new list item. - * @param note - Optional note for the new list item. - * @returns A Promise that resolves with the newly created list item payload. - */ - createItem(message: string, note?: string): Promise { - return this.client.lists.create(this.id, { - message, - note: note ? { content: note } : undefined, - }); - } + /** + * Creates a list item in this channel. + * + * @param message - The message of the new list item. + * @param note - Optional note for the new list item. + * @returns A Promise that resolves with the newly created list item payload. + */ + createItem(message: string, note?: string): Promise { + return this.client.lists.create(this.id, { + message, + note: note + ? { + content: note, + } + : undefined, + }); + } - /** - * Fetches a list item by its ID. - * - * @param itemId - The ID of the list item to fetch. - * @returns A Promise that resolves with the list item payload. - */ - async getItem(itemId: string): Promise { - const data = await this.client.lists.fetch(this.id, itemId); - this.items.set(data.id, data); - return data; - } + /** + * Fetches a list item by its ID. + * + * @param itemId - The ID of the list item to fetch. + * @returns A Promise that resolves with the list item payload. + */ + async getItem(itemId: string): Promise { + const data = await this.client.lists.fetch(this.id, itemId); + this.items.set(data.id, data); + return data; + } - /** - * Fetches all list items in this channel. - * - * @returns A Promise that resolves with an array of list item summary payloads. - */ - async getItems(): Promise { - const data = await this.client.lists.fetchMany(this.id); - for (const item of data) { - this.items.set(item.id, item); - } + /** + * Fetches all list items in this channel. + * + * @returns A Promise that resolves with an array of list item summary payloads. + */ + async getItems(): Promise { + const data = await this.client.lists.fetchMany(this.id); + for (const item of data) { + this.items.set(item.id, item); + } - return data; - } + return data; + } - /** - * Completes a list item. - * - * @param itemId - The ID of the list item to complete. - * @returns A Promise that resolves when the list item is completed. - */ - completeItem(itemId: string): Promise { - return this.client.lists.complete(this.id, itemId); - } + /** + * Completes a list item. + * + * @param itemId - The ID of the list item to complete. + * @returns A Promise that resolves when the list item is completed. + */ + completeItem(itemId: string): Promise { + return this.client.lists.complete(this.id, itemId); + } - /** - * Uncompletes a list item. - * - * @param itemId - The ID of the list item to uncomplete. - * @returns A Promise that resolves when the list item is uncompleted. - */ - uncompleteItem(itemId: string): Promise { - return this.client.lists.uncomplete(this.id, itemId); - } + /** + * Uncompletes a list item. + * + * @param itemId - The ID of the list item to uncomplete. + * @returns A Promise that resolves when the list item is uncompleted. + */ + uncompleteItem(itemId: string): Promise { + return this.client.lists.uncomplete(this.id, itemId); + } } diff --git a/packages/guilded.js/lib/structures/channels/ThreadChannel.ts b/packages/guilded.js/lib/structures/channels/ThreadChannel.ts index 82313348..9198afb3 100644 --- a/packages/guilded.js/lib/structures/channels/ThreadChannel.ts +++ b/packages/guilded.js/lib/structures/channels/ThreadChannel.ts @@ -3,26 +3,26 @@ import type { Client } from "../Client"; import { Channel } from "./Channel"; export class ThreadChannel extends Channel { - /** - * Root channel in the thread hierarchy - */ - rootId: string; + /** + * Root channel in the thread hierarchy + */ + rootId: string; - /** - * Immediate parent channel of this thread - */ - parentId: string; + /** + * Immediate parent channel of this thread + */ + parentId: string; - /** - * Message this thread channel is attached to - */ - messageId: string; + /** + * Message this thread channel is attached to + */ + messageId: string; - constructor(client: Client, data: ServerChannelPayload) { - super(client, data); + constructor(client: Client, data: ServerChannelPayload) { + super(client, data); - this.rootId = data.rootId!; - this.parentId = data.parentId!; - this.messageId = data.messageId!; - } + this.rootId = data.rootId!; + this.parentId = data.parentId!; + this.messageId = data.messageId!; + } } diff --git a/packages/guilded.js/lib/structures/collectors/Collector.ts b/packages/guilded.js/lib/structures/collectors/Collector.ts index b4fe8a9e..ef995a83 100644 --- a/packages/guilded.js/lib/structures/collectors/Collector.ts +++ b/packages/guilded.js/lib/structures/collectors/Collector.ts @@ -10,128 +10,134 @@ import type { Client } from "../Client"; * to have your code wait until further input from a user. */ export abstract class Collector { - /** Collection of successfully collected entries */ - readonly entries = new Collection(); - - /** Whether the collector is actively collecting elements */ - isActive = false; - - /** Method to resolve the promise this collector has when instantiated */ - protected resolve: ((value: CollectorReturnValue) => void) | null = null; - - /** Timeout for max time */ - protected maxTimeout: NodeJS.Timeout | null = null; - - /** Bound function for item receiving */ - protected boundItemReceiver = this.itemReceived.bind(this); - - public emitter = new EventEmitter() as TypedEmitter>; - - constructor(public readonly client: Client, public options: Partial>) { - /** Check if timeLimit is specified */ - if (!options.timeLimit) throw new Error("You must specify a time limit in milliseconds for this collector."); - } - - /** - * Start the collector - * - * @returns A promise that resolves with a `CollectorReturnValue` object - */ - start(): Promise> { - return new Promise((resolve) => { - this.resolve = resolve; - - this.maxTimeout = setTimeout(() => { - this.resolve!({ reason: CollectorEndReasons.TIME, entries: this.entries }); - this._cleanup(); - this.isActive = false; - }, this.options.timeLimit); - - this.hookEvents(); - this.isActive = true; - }); - } - - /** - * Receives an item - * - * @param entry - The item received - * @returns Whether the item passes the filter function or not - */ - async itemReceived(entry: T): Promise { - const elementPassesFilter = (await this.options.filter?.(entry)) ?? true; - if (elementPassesFilter) { - this.entries.set(entry.id, entry); - - if (this.entries.size >= (this.options.max ?? Number.POSITIVE_INFINITY)) { - clearTimeout(this.maxTimeout!); - this.maxTimeout = null; - this.resolve!({ - reason: CollectorEndReasons.MAX, - entries: this.entries, - }); - this._cleanup(); - this.isActive = false; - } - - this.emitter.emit("collect", entry); - return true; - } - - return false; - } - - /** - * Increment the max number of event listeners for the client - * - * @returns The new max number of event listeners for the client - */ - protected incrementMaxEventListeners(): number { - const incrementedAmount = this.client.getMaxListeners() + 1; - this.client.setMaxListeners(incrementedAmount); - return incrementedAmount; - } - - /** - * Decrement the max number of event listeners for the client - * - * @returns The new max number of event listeners for the client - */ - protected decrementMaxEventListeners(): number { - const decrementAmount = this.client.getMaxListeners() - 1; - if (decrementAmount !== 0) { - this.client.setMaxListeners(decrementAmount); - return decrementAmount; - } - - return 0; - } - - /** - * Hook events to the collector - */ - abstract hookEvents(): void; - - /** - * Clean up the collector - */ - abstract _cleanup(): void; + /** Collection of successfully collected entries */ + readonly entries = new Collection(); + + /** Whether the collector is actively collecting elements */ + isActive = false; + + /** Method to resolve the promise this collector has when instantiated */ + protected resolve: ((value: CollectorReturnValue) => void) | null = null; + + /** Timeout for max time */ + protected maxTimeout: NodeJS.Timeout | null = null; + + /** Bound function for item receiving */ + protected boundItemReceiver = this.itemReceived.bind(this); + + public emitter = new EventEmitter() as TypedEmitter>; + + constructor( + public readonly client: Client, + public options: Partial>, + ) { + /** Check if timeLimit is specified */ + if (!options.timeLimit) throw new Error("You must specify a time limit in milliseconds for this collector."); + } + + /** + * Start the collector + * + * @returns A promise that resolves with a `CollectorReturnValue` object + */ + start(): Promise> { + return new Promise((resolve) => { + this.resolve = resolve; + + this.maxTimeout = setTimeout(() => { + this.resolve?.({ + reason: CollectorEndReasons.TIME, + entries: this.entries, + }); + this._cleanup(); + this.isActive = false; + }, this.options.timeLimit); + + this.hookEvents(); + this.isActive = true; + }); + } + + /** + * Receives an item + * + * @param entry - The item received + * @returns Whether the item passes the filter function or not + */ + async itemReceived(entry: T): Promise { + const elementPassesFilter = (await this.options.filter?.(entry)) ?? true; + if (elementPassesFilter) { + this.entries.set(entry.id, entry); + + if (this.entries.size >= (this.options.max ?? Number.POSITIVE_INFINITY)) { + clearTimeout(this.maxTimeout!); + this.maxTimeout = null; + this.resolve?.({ + reason: CollectorEndReasons.MAX, + entries: this.entries, + }); + this._cleanup(); + this.isActive = false; + } + + this.emitter.emit("collect", entry); + return true; + } + + return false; + } + + /** + * Increment the max number of event listeners for the client + * + * @returns The new max number of event listeners for the client + */ + protected incrementMaxEventListeners(): number { + const incrementedAmount = this.client.getMaxListeners() + 1; + this.client.setMaxListeners(incrementedAmount); + return incrementedAmount; + } + + /** + * Decrement the max number of event listeners for the client + * + * @returns The new max number of event listeners for the client + */ + protected decrementMaxEventListeners(): number { + const decrementAmount = this.client.getMaxListeners() - 1; + if (decrementAmount !== 0) { + this.client.setMaxListeners(decrementAmount); + return decrementAmount; + } + + return 0; + } + + /** + * Hook events to the collector + */ + abstract hookEvents(): void; + + /** + * Clean up the collector + */ + abstract _cleanup(): void; } /** * Reasons why a collector has ended */ export enum CollectorEndReasons { - MAX = "MAX_AMOUNT", - TIME = "TIME_EXPIRED", + MAX = "MAX_AMOUNT", + TIME = "TIME_EXPIRED", } /** * The value returned by a collector when it ends */ export type CollectorReturnValue = { - reason: CollectorEndReasons; - entries: Collection; + reason: CollectorEndReasons; + entries: Collection; }; /** @@ -141,15 +147,15 @@ type CollectableStructure = { id: string }; /** options for constructing a collector */ export type CollectorOptions = { - /** a function that determines whether an entry is collected or not */ - filter?(item: T): MaybePromise; - /** the max amount of time this collector run for before exiting (ms) */ - timeLimit: number; - /** the max amount of entries allowed to be collected */ - max?: number; + /** a function that determines whether an entry is collected or not */ + filter?(item: T): MaybePromise; + /** the max amount of time this collector run for before exiting (ms) */ + timeLimit: number; + /** the max amount of entries allowed to be collected */ + max?: number; }; /** events that collectors can emit */ export type CollectorEvents = { - collect(item: T): unknown; + collect(item: T): unknown; }; diff --git a/packages/guilded.js/lib/structures/collectors/MessageCollector.ts b/packages/guilded.js/lib/structures/collectors/MessageCollector.ts index 241cbd57..7734adc7 100644 --- a/packages/guilded.js/lib/structures/collectors/MessageCollector.ts +++ b/packages/guilded.js/lib/structures/collectors/MessageCollector.ts @@ -9,19 +9,19 @@ import { Collector } from "./Collector"; * @extends Collector */ export class MessageCollector extends Collector { - /** - * Binds to the client's message creation event and increments its max listener count by one. - */ - hookEvents(): void { - this.incrementMaxEventListeners(); - this.client.on(constants.clientEvents.MESSAGE_CREATED, this.boundItemReceiver); - } + /** + * Binds to the client's message creation event and increments its max listener count by one. + */ + hookEvents(): void { + this.incrementMaxEventListeners(); + this.client.on(constants.clientEvents.MESSAGE_CREATED, this.boundItemReceiver); + } - /** - * Unbinds from the client's message creation event and decrements its max listener count by one. - */ - _cleanup(): void { - this.decrementMaxEventListeners(); - this.client.removeListener(constants.clientEvents.MESSAGE_CREATED, this.boundItemReceiver); - } + /** + * Unbinds from the client's message creation event and decrements its max listener count by one. + */ + _cleanup(): void { + this.decrementMaxEventListeners(); + this.client.removeListener(constants.clientEvents.MESSAGE_CREATED, this.boundItemReceiver); + } } diff --git a/packages/guilded.js/lib/structures/collectors/ReactionCollector.ts b/packages/guilded.js/lib/structures/collectors/ReactionCollector.ts index 11054618..ec0cf90c 100644 --- a/packages/guilded.js/lib/structures/collectors/ReactionCollector.ts +++ b/packages/guilded.js/lib/structures/collectors/ReactionCollector.ts @@ -7,21 +7,21 @@ import { Collector } from "./Collector"; * A collector that collects reactions on messages */ export class ReactionCollector extends Collector { - /** - * Hooks the necessary events to start collecting reactions - */ - hookEvents(): void { - this.incrementMaxEventListeners(); - this.client.on(constants.clientEvents.MESSAGE_REACTION_CREATED, this.boundItemReceiver); - } + /** + * Hooks the necessary events to start collecting reactions + */ + hookEvents(): void { + this.incrementMaxEventListeners(); + this.client.on(constants.clientEvents.MESSAGE_REACTION_CREATED, this.boundItemReceiver); + } - /** - * Cleans up events and listeners after the collector has stopped collecting - */ - _cleanup(): void { - this.decrementMaxEventListeners(); - this.client.removeListener(constants.clientEvents.MESSAGE_REACTION_CREATED, this.boundItemReceiver); - } + /** + * Cleans up events and listeners after the collector has stopped collecting + */ + _cleanup(): void { + this.decrementMaxEventListeners(); + this.client.removeListener(constants.clientEvents.MESSAGE_REACTION_CREATED, this.boundItemReceiver); + } } /** diff --git a/packages/guilded.js/lib/typings.ts b/packages/guilded.js/lib/typings.ts index 7da6a476..8aad7aea 100644 --- a/packages/guilded.js/lib/typings.ts +++ b/packages/guilded.js/lib/typings.ts @@ -1,14 +1,14 @@ import type { Collection } from "@discordjs/collection"; import type { - ChatService, - DocPayload, - EmbedPayload, - ListItemPayload, - ListItemSummaryPayload, - ServerMemberBanPayload, - ServerMemberPayload, - ServerMemberSummaryPayload, - SocialLinkPayload, + ChatService, + DocPayload, + EmbedPayload, + ListItemPayload, + ListItemSummaryPayload, + ServerMemberBanPayload, + ServerMemberPayload, + ServerMemberSummaryPayload, + SocialLinkPayload, } from "@guildedjs/api"; import type { MemberRemovedEvent, MemberUnbannedEvent, MemberUpdatedEvent, MessageDeletedEvent, MessageReactionDeletedEvent } from "./events"; import type { Channel, Embed, Member, MemberBan, Message, MessageReaction, Webhook } from "./structures"; @@ -17,11 +17,13 @@ import type { ForumTopic } from "./structures/Forum"; import type { Server } from "./structures/Server"; export type BareStructureBaseData = { - id: string; + id: string; }; -export type OptionBody any> = Parameters[0]["requestBody"]; -export type OptionQuery any> = Parameters[0]; +// biome-ignore lint/suspicious/noExplicitAny: Needed +export type OptionBody unknown> = Parameters[0]["requestBody"]; +// biome-ignore lint/suspicious/noExplicitAny: Needed +export type OptionQuery unknown> = Parameters[0]; export type UpgradedServerMemberPayload = IDUpgradePayload>; export type UpgradedServerMemberBanPayload = ServerUpgradePayload; @@ -29,62 +31,73 @@ export type UpgradedServerMemberSummaryPayload = IDUpgradePayload = T & { serverId: string }; export type IDUpgradePayload = T & { id: string }; -export type MessageContent = Embed | OptionBody | string | (Omit, "embeds"> & { embeds?: Embed[] }); +export type MessageContent = + | Embed + | OptionBody + | string + | (Omit, "embeds"> & { + embeds?: Embed[]; + }); export type MaybePromise = Promise | T; export type ClientEvents = { - ready(): unknown; - debug(data: any): unknown; - exit(): unknown; - error(reason: string, err: Error | null): unknown; - calendarEventCreated(calendarEvent: CalendarEvent): unknown; - calendarEventUpdated(calendarEvent: CalendarEvent, oldCalendar: CalendarEvent | null): unknown; - calendarEventDeleted(calendarEvent: CalendarEvent): unknown; - calendarRsvpUpdated(calendarEventRsvp: CalendarEventRsvp, oldCalendarRsvp: CalendarEventRsvp | null): unknown; - calendarRsvpManyUpdated(calendarRsvpsEvent: Collection): unknown; - calendarRsvpDeleted(calendarEventRsvp: CalendarEventRsvp): unknown; - messageCreated(message: Message): unknown; - messageUpdated(message: Message, oldMessage: Message | null): unknown; - messageDeleted(event: MessageDeletedEvent): unknown; - messageReactionCreated(reaction: MessageReaction): unknown; - messageReactionDeleted(event: MessageReactionDeletedEvent): unknown; - channelCreated(channel: Channel): unknown; - channelUpdated(channel: Channel, oldChannel: Channel | null): unknown; - channelDeleted(channel: Channel): unknown; - docCreated(doc: DocPayload): unknown; - docUpdated(newDoc: DocPayload, oldDoc: DocPayload | null): unknown; - docDeleted(doc: DocPayload): unknown; - listItemCreated(item: ListItemPayload): unknown; - listItemUpdated(newItem: ListItemPayload, oldItem: ListItemPayload | ListItemSummaryPayload | null): unknown; - listItemDeleted(item: ListItemPayload): unknown; - listItemCompleted(item: ListItemPayload): unknown; - listItemUncompleted(item: ListItemPayload): unknown; - memberJoined(member: Member): unknown; - memberRemoved(event: MemberRemovedEvent): unknown; - memberUpdated(event: MemberUpdatedEvent): unknown; - memberBanned(ban: MemberBan): unknown; - memberUnbanned(event: MemberUnbannedEvent): unknown; - memberSocialLinkCreated(serverId: string, socialLink: SocialLinkPayload): unknown; - memberSocialLinkUpdated(serverId: string, socialLink: SocialLinkPayload): unknown; - memberSocialLinkDeleted(serverId: string, socialLink: SocialLinkPayload): unknown; - botServerCreated(server: Server, user: string): unknown; - botServerDeleted(server: Server, user: string): unknown; - forumTopicCreated(topic: ForumTopic): unknown; - forumTopicUpdated(topic: ForumTopic, oldTopic: ForumTopic | null): unknown; - forumTopicDeleted(topic: ForumTopic): unknown; - forumTopicPinned(topic: ForumTopic): unknown; - forumTopicUnpinned(topic: ForumTopic): unknown; - forumTopicLocked(topic: ForumTopic): unknown; - forumTopicUnlocked(topic: ForumTopic): unknown; - serverCreated(server: { serverId: string }): unknown; - webhookCreated(webhook: Webhook): unknown; - webhookUpdated(webhook: Webhook, oldWebhook: Webhook | null): unknown; - rolesUpdated( - updatedMembers: { - serverId: string; - members: { userId: string; roleIds: number[] }[]; - }, - oldMembers: Member[], - ): unknown; - unknownGatewayEvent(data: any): unknown; + ready(): unknown; + debug(data: unknown): unknown; + exit(): unknown; + error(reason: string, err: Error | null): unknown; + calendarEventCreated(calendarEvent: CalendarEvent): unknown; + calendarEventUpdated(calendarEvent: CalendarEvent, oldCalendar: CalendarEvent | null): unknown; + calendarEventDeleted(calendarEvent: CalendarEvent): unknown; + calendarRsvpUpdated(calendarEventRsvp: CalendarEventRsvp, oldCalendarRsvp: CalendarEventRsvp | null): unknown; + calendarRsvpManyUpdated(calendarRsvpsEvent: Collection): unknown; + calendarRsvpDeleted(calendarEventRsvp: CalendarEventRsvp): unknown; + messageCreated(message: Message): unknown; + messageUpdated(message: Message, oldMessage: Message | null): unknown; + messageDeleted(event: MessageDeletedEvent): unknown; + messageReactionCreated(reaction: MessageReaction): unknown; + messageReactionDeleted(event: MessageReactionDeletedEvent): unknown; + channelCreated(channel: Channel): unknown; + channelUpdated(channel: Channel, oldChannel: Channel | null): unknown; + channelDeleted(channel: Channel): unknown; + docCreated(doc: DocPayload): unknown; + docUpdated(newDoc: DocPayload, oldDoc: DocPayload | null): unknown; + docDeleted(doc: DocPayload): unknown; + listItemCreated(item: ListItemPayload): unknown; + listItemUpdated(newItem: ListItemPayload, oldItem: ListItemPayload | ListItemSummaryPayload | null): unknown; + listItemDeleted(item: ListItemPayload): unknown; + listItemCompleted(item: ListItemPayload): unknown; + listItemUncompleted(item: ListItemPayload): unknown; + memberJoined(member: Member): unknown; + memberRemoved(event: MemberRemovedEvent): unknown; + memberUpdated(event: MemberUpdatedEvent): unknown; + memberBanned(ban: MemberBan): unknown; + memberUnbanned(event: MemberUnbannedEvent): unknown; + memberSocialLinkCreated(serverId: string, socialLink: SocialLinkPayload): unknown; + memberSocialLinkUpdated(serverId: string, socialLink: SocialLinkPayload): unknown; + memberSocialLinkDeleted(serverId: string, socialLink: SocialLinkPayload): unknown; + botServerCreated(server: Server, user: string): unknown; + botServerDeleted(server: Server, user: string): unknown; + forumTopicCreated(topic: ForumTopic): unknown; + forumTopicUpdated(topic: ForumTopic, oldTopic: ForumTopic | null): unknown; + forumTopicDeleted(topic: ForumTopic): unknown; + forumTopicPinned(topic: ForumTopic): unknown; + forumTopicUnpinned(topic: ForumTopic): unknown; + forumTopicLocked(topic: ForumTopic): unknown; + forumTopicUnlocked(topic: ForumTopic): unknown; + serverCreated(server: { + serverId: string; + }): unknown; + webhookCreated(webhook: Webhook): unknown; + webhookUpdated(webhook: Webhook, oldWebhook: Webhook | null): unknown; + rolesUpdated( + updatedMembers: { + serverId: string; + members: { + userId: string; + roleIds: number[]; + }[]; + }, + oldMembers: Member[], + ): unknown; + unknownGatewayEvent(data: unknown): unknown; }; diff --git a/packages/guilded.js/lib/util.ts b/packages/guilded.js/lib/util.ts index 82601cfe..8e1040de 100644 --- a/packages/guilded.js/lib/util.ts +++ b/packages/guilded.js/lib/util.ts @@ -8,9 +8,9 @@ import type { MessageContent } from "./typings"; * Valid image file extensions */ export enum IMG_EXTENSION { - GIF = "gif", - PNG = "png", - WEBP = "webp", + GIF = "gif", + PNG = "png", + WEBP = "webp", } /** @@ -30,74 +30,74 @@ export type IMG_SIZE = "Large" | "Medium" | "Small"; * @returns A URL string for the asset */ const formAssetURL = (route: string, hash: string, extension: string, width?: number, height?: number, size?: string): string => { - const url = new URL(`https://${DOMAINS.IMAGE_CDN_DOMAIN}/${route}/${hash}-${size}.${extension.toLowerCase()}`); - if (width) url.searchParams.append("w", width.toString()); - if (height) url.searchParams.append("h", height.toString()); - return url.toString(); + const url = new URL(`https://${DOMAINS.IMAGE_CDN_DOMAIN}/${route}/${hash}-${size}.${extension.toLowerCase()}`); + if (width) url.searchParams.append("w", width.toString()); + if (height) url.searchParams.append("h", height.toString()); + return url.toString(); }; /** * Object containing functions to build Guilded asset URLs */ export const ASSET_BUILDER = { - /** - * Function to build a Guilded user avatar URL - * - * @param hash - The hash of the user's avatar - * @param size - The size of the avatar (optional) - * @returns A URL string for the user avatar - */ - AVATAR_URL: (hash: string, size: IMG_SIZE = "Medium"): string => formAssetURL("UserAvatar", hash, IMG_EXTENSION.PNG, undefined, undefined, size), - /** - * Function to build a Guilded chat message image URL - * - * @param hash - The hash of the image - * @param size - The size of the image (optional) - * @param width - The width of the image (optional) - * @param height - The height of the image (optional) - * @returns A URL string for the image in a chat message - */ - IMAGE_IN_CHAT: (hash: string, size = "Full", width?: number, height?: number): string => formAssetURL("ContentMedia", hash, IMG_EXTENSION.WEBP, width, height, size), - /** - * Function to build a Guilded user profile banner URL - * - * @param hash - The hash of the user's banner - * @param size - The size of the banner (optional) - * @param width - The width of the banner (optional) - * @param height - The height of the banner (optional) - * @returns A URL string for the user profile banner - */ - PROFILE_BANNER: (hash: string, size = "Hero", width?: number, height?: number): string => formAssetURL("UserBanner", hash, IMG_EXTENSION.PNG, width, height, size), - /** - * Builds a URL for a server banner asset. - * - * @param hash - The hash of the banner asset. - * @param size - The size of the banner asset. Default value is "Hero". - * @param width - The width of the banner asset. Defaults to undefined. - * @param height - The height of the banner asset. Defaults to undefined. - * @returns The URL of the server banner asset. - */ - SERVER_BANNER: (hash: string, size = "Hero", width?: number, height?: number): string => formAssetURL("TeamBanner", hash, IMG_EXTENSION.PNG, width, height, size), - /** - * Builds a URL for a server emoji asset. - * - * @param hash - The hash of the emoji asset. - * @param size - The size of the emoji asset. Default value is "Full". - * @param extension - The extension of the emoji asset. Default value is "WEBP". - * @param width - The width of the emoji asset. Defaults to undefined. - * @param height - The height of the emoji asset. Defaults to undefined. - * @returns The URL of the server emoji asset. - */ - SERVER_EMOJI: (hash: string, size = "Full", extension: "APNG" | "WEBP" = "WEBP", width?: number, height?: number): string => - formAssetURL("CustomReaction", hash, extension.toLowerCase(), width, height, size), - /** - * Builds a URL for a server icon asset. - * - * @param hash - The hash of the icon asset. - * @param size - The size of the icon asset. Default value is "Medium". - * @returns The URL of the server icon asset. - */ - SERVER_ICON: (hash: string, size: "Large" | "Medium" | "Small" = "Medium"): string => formAssetURL("TeamAvatar", hash, IMG_EXTENSION.PNG, undefined, undefined, size), + /** + * Function to build a Guilded user avatar URL + * + * @param hash - The hash of the user's avatar + * @param size - The size of the avatar (optional) + * @returns A URL string for the user avatar + */ + AVATAR_URL: (hash: string, size: IMG_SIZE = "Medium"): string => formAssetURL("UserAvatar", hash, IMG_EXTENSION.PNG, undefined, undefined, size), + /** + * Function to build a Guilded chat message image URL + * + * @param hash - The hash of the image + * @param size - The size of the image (optional) + * @param width - The width of the image (optional) + * @param height - The height of the image (optional) + * @returns A URL string for the image in a chat message + */ + IMAGE_IN_CHAT: (hash: string, size = "Full", width?: number, height?: number): string => formAssetURL("ContentMedia", hash, IMG_EXTENSION.WEBP, width, height, size), + /** + * Function to build a Guilded user profile banner URL + * + * @param hash - The hash of the user's banner + * @param size - The size of the banner (optional) + * @param width - The width of the banner (optional) + * @param height - The height of the banner (optional) + * @returns A URL string for the user profile banner + */ + PROFILE_BANNER: (hash: string, size = "Hero", width?: number, height?: number): string => formAssetURL("UserBanner", hash, IMG_EXTENSION.PNG, width, height, size), + /** + * Builds a URL for a server banner asset. + * + * @param hash - The hash of the banner asset. + * @param size - The size of the banner asset. Default value is "Hero". + * @param width - The width of the banner asset. Defaults to undefined. + * @param height - The height of the banner asset. Defaults to undefined. + * @returns The URL of the server banner asset. + */ + SERVER_BANNER: (hash: string, size = "Hero", width?: number, height?: number): string => formAssetURL("TeamBanner", hash, IMG_EXTENSION.PNG, width, height, size), + /** + * Builds a URL for a server emoji asset. + * + * @param hash - The hash of the emoji asset. + * @param size - The size of the emoji asset. Default value is "Full". + * @param extension - The extension of the emoji asset. Default value is "WEBP". + * @param width - The width of the emoji asset. Defaults to undefined. + * @param height - The height of the emoji asset. Defaults to undefined. + * @returns The URL of the server emoji asset. + */ + SERVER_EMOJI: (hash: string, size = "Full", extension: "APNG" | "WEBP" = "WEBP", width?: number, height?: number): string => + formAssetURL("CustomReaction", hash, extension.toLowerCase(), width, height, size), + /** + * Builds a URL for a server icon asset. + * + * @param hash - The hash of the icon asset. + * @param size - The size of the icon asset. Default value is "Medium". + * @returns The URL of the server icon asset. + */ + SERVER_ICON: (hash: string, size: "Large" | "Medium" | "Small" = "Medium"): string => formAssetURL("TeamAvatar", hash, IMG_EXTENSION.PNG, undefined, undefined, size), }; /** @@ -108,7 +108,7 @@ export const ASSET_BUILDER = { * @returns The key for the member object. */ export const buildMemberKey = (serverId: string, memberId: string): string => { - return `${serverId}:${memberId}`; + return `${serverId}:${memberId}`; }; /** @@ -120,7 +120,7 @@ export const buildMemberKey = (serverId: string, memberId: string): string => { * @returns The key for the reaction object. */ export const buildMessageReactionKey = (messageId: string, userId: string, emoteId: number): string => { - return `${messageId}:${userId}:${emoteId}`; + return `${messageId}:${userId}:${emoteId}`; }; /** @@ -131,11 +131,11 @@ export const buildMessageReactionKey = (messageId: string, userId: string, emote * @returns The key for the reaction object. */ export const buildReactionKey = (userId: string, emoteId: number): string => { - return `${userId}:${emoteId}`; + return `${userId}:${emoteId}`; }; export const buildCalendarRsvpKey = (calendarEventId: number, userId: string): string => { - return `${calendarEventId}:${userId}`; + return `${calendarEventId}:${userId}`; }; /** @@ -145,13 +145,19 @@ export const buildCalendarRsvpKey = (calendarEventId: number, userId: string): s * @returns REST message data. */ export const resolveContentToData = (content: MessageContent): { content?: string; embeds?: ChatEmbed[] } => { - if (typeof content === "string") return { content }; - if (content instanceof Embed) return { embeds: [content.toJSON()] }; + if (typeof content === "string") + return { + content, + }; + if (content instanceof Embed) + return { + embeds: [content.toJSON()], + }; - return { - ...content, - embeds: content.embeds?.map((x) => (x instanceof Embed ? x.toJSON() : x)), - }; + return { + ...content, + embeds: content.embeds?.map((x) => (x instanceof Embed ? x.toJSON() : x)), + }; }; /** @@ -160,5 +166,5 @@ export const resolveContentToData = (content: MessageContent): { content?: strin * @param date - The date to convert */ export function parseToStamp(date: string | undefined): number | null { - return date ? Date.parse(date) : null; + return date ? Date.parse(date) : null; } diff --git a/packages/guilded.js/package.json b/packages/guilded.js/package.json index 918d2980..ab15ec2b 100644 --- a/packages/guilded.js/package.json +++ b/packages/guilded.js/package.json @@ -7,10 +7,9 @@ "types": "types/index.d.ts", "main": "dist/index.js", "scripts": { - "lint": "eslint --ignore-path ../../.config/.eslintignore --config ../../.config/.eslintrc.js lib", "build": "tsc && gen-esm-wrapper . ./dist/index.mjs", "build:typecheck": "tsc --noEmit", - "prepublishOnly": "rimraf dist/ && rimraf types/ && pnpm run build" + "prepublishOnly": "rimraf dist/ && rimraf types/ && bun run build" }, "devDependencies": { "@types/node": "18.16.12", @@ -72,4 +71,4 @@ "url": "https://github.com/zaida04/guilded.js/issues" }, "gitHead": "eee38a19e0bfa812d7136cc78a6bc99e0b402b0c" -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 8bf26ace..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,7364 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@changesets/cli': - specifier: ^2.26.1 - version: 2.26.1 - '@types/node': - specifier: 18.16.12 - version: 18.16.12 - dotenv: - specifier: 16.0.3 - version: 16.0.3 - eslint: - specifier: 8.40.0 - version: 8.40.0 - eslint-config-neon: - specifier: 0.1.47 - version: 0.1.47(eslint@8.40.0)(svelte@3.59.2)(typescript@5.0.4) - gen-esm-wrapper: - specifier: 1.1.3 - version: 1.1.3 - husky: - specifier: 7.0.4 - version: 7.0.4 - lint-staged: - specifier: 13.2.2 - version: 13.2.2 - nodemon: - specifier: ^2.0.22 - version: 2.0.22 - pnpm: - specifier: 8.5.1 - version: 8.5.1 - prettier: - specifier: 2.8.8 - version: 2.8.8 - rimraf: - specifier: 5.0.1 - version: 5.0.1 - ts-node: - specifier: 10.9.1 - version: 10.9.1(@types/node@18.16.12)(typescript@5.0.4) - typedoc: - specifier: 0.24.7 - version: 0.24.7(typescript@5.0.4) - typescript: - specifier: 5.0.4 - version: 5.0.4 - - apps/docs: - dependencies: - '@fortawesome/fontawesome-svg-core': - specifier: ^6.4.0 - version: 6.4.0 - '@fortawesome/free-solid-svg-icons': - specifier: ^6.4.0 - version: 6.4.0 - '@fortawesome/react-fontawesome': - specifier: ^0.2.0 - version: 0.2.0(@fortawesome/fontawesome-svg-core@6.4.0)(react@18.2.0) - '@next/font': - specifier: ^13.4.2 - version: 13.4.6 - next: - specifier: 13.4.2 - version: 13.4.2(react-dom@18.2.0)(react@18.2.0) - react: - specifier: 18.2.0 - version: 18.2.0 - react-code-blocks: - specifier: 0.0.9-0 - version: 0.0.9-0(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0) - react-dom: - specifier: 18.2.0 - version: 18.2.0(react@18.2.0) - devDependencies: - '@types/node': - specifier: 18.16.12 - version: 18.16.12 - '@types/react': - specifier: 18.2.6 - version: 18.2.6 - '@types/react-dom': - specifier: 18.2.4 - version: 18.2.4 - autoprefixer: - specifier: ^10.4.14 - version: 10.4.14(postcss@8.4.24) - postcss: - specifier: ^8.4.23 - version: 8.4.24 - tailwindcss: - specifier: ^3.3.2 - version: 3.3.2(ts-node@10.9.1) - typedoc: - specifier: 0.23.24 - version: 0.23.24(typescript@5.0.4) - typescript: - specifier: 5.0.4 - version: 5.0.4 - - packages/api: - dependencies: - '@types/ws': - specifier: 8.5.4 - version: 8.5.4 - form-data: - specifier: ^4.0.0 - version: 4.0.0 - node-fetch: - specifier: 2.6.11 - version: 2.6.11 - qs: - specifier: ^6.11.2 - version: 6.11.2 - typed-emitter: - specifier: 2.1.0 - version: 2.1.0 - ws: - specifier: 8.13.0 - version: 8.13.0 - devDependencies: - '@types/fs-extra': - specifier: ^11.0.1 - version: 11.0.1 - '@types/node-fetch': - specifier: 2.6.4 - version: 2.6.4 - '@types/qs': - specifier: ^6.9.7 - version: 6.9.7 - fs-extra: - specifier: ^11.1.1 - version: 11.1.1 - openapi-typescript: - specifier: ^6.2.4 - version: 6.2.8 - openapi-typescript-codegen: - specifier: ^0.24.0 - version: 0.24.0 - ts-node: - specifier: 10.9.1 - version: 10.9.1(@types/node@18.16.12)(typescript@5.0.4) - typescript: - specifier: 5.0.4 - version: 5.0.4 - - packages/create-guilded-app: - dependencies: - create-create-app: - specifier: ^7.3.0 - version: 7.3.0 - devDependencies: - '@types/node': - specifier: 18.16.12 - version: 18.16.12 - typescript: - specifier: 5.0.4 - version: 5.0.4 - - packages/gil: - dependencies: - '@discordjs/collection': - specifier: ^1.5.1 - version: 1.5.1 - colorette: - specifier: ^2.0.20 - version: 2.0.20 - guilded.js: - specifier: workspace:* - version: link:../guilded.js - devDependencies: - dotenv: - specifier: ^16.0.3 - version: 16.3.1 - typescript: - specifier: 5.0.4 - version: 5.0.4 - - packages/guilded.js: - dependencies: - '@discordjs/collection': - specifier: ^1.5.1 - version: 1.5.1 - '@guildedjs/api': - specifier: workspace:* - version: link:../api - typed-emitter: - specifier: 2.1.0 - version: 2.1.0 - devDependencies: - '@types/node': - specifier: 18.16.12 - version: 18.16.12 - typescript: - specifier: 5.0.4 - version: 5.0.4 - - services/proxy: - dependencies: - '@guildedjs/api': - specifier: workspace:* - version: link:../../packages/api - dotenv: - specifier: ^16.0.3 - version: 16.3.1 - devDependencies: - '@types/node': - specifier: 18.16.12 - version: 18.16.12 - typescript: - specifier: 5.0.4 - version: 5.0.4 - -packages: - - /@alloc/quick-lru@5.2.0: - resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} - engines: {node: '>=10'} - dev: true - - /@angular-eslint/bundled-angular-compiler@16.0.3: - resolution: {integrity: sha512-8zwY6ustiPXBEF3+jELKVwGk6j2HJn7GHbqAhDFR02YiE27iRMSGTHIAWGs6ZI7F1JgfrIsOHrUgzC1x95K6rg==} - dev: true - - /@angular-eslint/eslint-plugin-template@16.0.3(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-OKTMWOjC7F5tdv7gm2tlmgyr/uVyS1RWJZn4X/6D6p0kOpiDXmajtbYHD5tzbshX2Ep62Nt+rg8+1XGHrU0ScA==} - peerDependencies: - eslint: ^7.20.0 || ^8.0.0 - typescript: '*' - dependencies: - '@angular-eslint/bundled-angular-compiler': 16.0.3 - '@angular-eslint/utils': 16.0.3(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/type-utils': 5.59.7(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/utils': 5.59.7(eslint@8.40.0)(typescript@5.0.4) - aria-query: 5.1.3 - axobject-query: 3.1.1 - eslint: 8.40.0 - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@angular-eslint/eslint-plugin@16.0.3(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-1c+dFytcQDOA2wJ8/rtydMV6UYq1BgVfOcBXOr0WJxC9g8Cad9czcUOkW41WGrTp5kICMliV0ypH5eEaCM2WDQ==} - peerDependencies: - eslint: ^7.20.0 || ^8.0.0 - typescript: '*' - dependencies: - '@angular-eslint/utils': 16.0.3(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/utils': 5.59.7(eslint@8.40.0)(typescript@5.0.4) - eslint: 8.40.0 - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@angular-eslint/template-parser@16.0.3(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-IAWdwp/S9QC3EMiVxSS0E3ABy9PSidN3PW0Ll2EtM3mzXMYlpZXmxqd+B1xV/xKWzhk1Mp04QX8hHfG6Vq+qaQ==} - peerDependencies: - eslint: ^7.20.0 || ^8.0.0 - typescript: '*' - dependencies: - '@angular-eslint/bundled-angular-compiler': 16.0.3 - eslint: 8.40.0 - eslint-scope: 7.2.0 - typescript: 5.0.4 - dev: true - - /@angular-eslint/utils@16.0.3(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-QsbUVHJLk+fE08/D4y3wOyGk1iX2LVSygw+uzilbaAXfjD5/c0Ei5FbVx2mMYPk+aOl4yrvGQW3dmetMiAR0MQ==} - peerDependencies: - eslint: ^7.20.0 || ^8.0.0 - typescript: '*' - dependencies: - '@angular-eslint/bundled-angular-compiler': 16.0.3 - '@typescript-eslint/utils': 5.59.7(eslint@8.40.0)(typescript@5.0.4) - eslint: 8.40.0 - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@apidevtools/json-schema-ref-parser@9.0.9: - resolution: {integrity: sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==} - dependencies: - '@jsdevtools/ono': 7.1.3 - '@types/json-schema': 7.0.12 - call-me-maybe: 1.0.2 - js-yaml: 4.1.0 - dev: true - - /@astrojs/compiler@1.5.1: - resolution: {integrity: sha512-iIGKu/uzB8sJ5VveQf0eHrVPPFEcrvSlp4qShYMOuY2aMmK2RVXQlX9dUjtmBQ+NAokfIOb7fwCutvH+p13l+g==} - dev: true - - /@babel/code-frame@7.22.5: - resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/highlight': 7.22.5 - - /@babel/generator@7.22.5: - resolution: {integrity: sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.5 - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 - jsesc: 2.5.2 - - /@babel/helper-annotate-as-pure@7.22.5: - resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.5 - dev: false - - /@babel/helper-environment-visitor@7.22.5: - resolution: {integrity: sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==} - engines: {node: '>=6.9.0'} - - /@babel/helper-function-name@7.22.5: - resolution: {integrity: sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.22.5 - '@babel/types': 7.22.5 - - /@babel/helper-hoist-variables@7.22.5: - resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.5 - - /@babel/helper-module-imports@7.22.5: - resolution: {integrity: sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.5 - dev: false - - /@babel/helper-split-export-declaration@7.22.5: - resolution: {integrity: sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.5 - - /@babel/helper-string-parser@7.22.5: - resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} - engines: {node: '>=6.9.0'} - - /@babel/helper-validator-identifier@7.22.5: - resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==} - engines: {node: '>=6.9.0'} - - /@babel/highlight@7.22.5: - resolution: {integrity: sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-validator-identifier': 7.22.5 - chalk: 2.4.2 - js-tokens: 4.0.0 - - /@babel/parser@7.22.5: - resolution: {integrity: sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.22.5 - - /@babel/runtime@7.22.5: - resolution: {integrity: sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==} - engines: {node: '>=6.9.0'} - dependencies: - regenerator-runtime: 0.13.11 - - /@babel/template@7.22.5: - resolution: {integrity: sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.22.5 - '@babel/parser': 7.22.5 - '@babel/types': 7.22.5 - - /@babel/traverse@7.22.5(supports-color@5.5.0): - resolution: {integrity: sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.22.5 - '@babel/generator': 7.22.5 - '@babel/helper-environment-visitor': 7.22.5 - '@babel/helper-function-name': 7.22.5 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.5 - '@babel/parser': 7.22.5 - '@babel/types': 7.22.5 - debug: 4.3.4(supports-color@5.5.0) - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - - /@babel/types@7.22.5: - resolution: {integrity: sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.22.5 - '@babel/helper-validator-identifier': 7.22.5 - to-fast-properties: 2.0.0 - - /@changesets/apply-release-plan@6.1.3: - resolution: {integrity: sha512-ECDNeoc3nfeAe1jqJb5aFQX7CqzQhD2klXRez2JDb/aVpGUbX673HgKrnrgJRuQR/9f2TtLoYIzrGB9qwD77mg==} - dependencies: - '@babel/runtime': 7.22.5 - '@changesets/config': 2.3.0 - '@changesets/get-version-range-type': 0.3.2 - '@changesets/git': 2.0.0 - '@changesets/types': 5.2.1 - '@manypkg/get-packages': 1.1.3 - detect-indent: 6.1.0 - fs-extra: 7.0.1 - lodash.startcase: 4.4.0 - outdent: 0.5.0 - prettier: 2.8.8 - resolve-from: 5.0.0 - semver: 5.7.1 - dev: true - - /@changesets/assemble-release-plan@5.2.3: - resolution: {integrity: sha512-g7EVZCmnWz3zMBAdrcKhid4hkHT+Ft1n0mLussFMcB1dE2zCuwcvGoy9ec3yOgPGF4hoMtgHaMIk3T3TBdvU9g==} - dependencies: - '@babel/runtime': 7.22.5 - '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.5 - '@changesets/types': 5.2.1 - '@manypkg/get-packages': 1.1.3 - semver: 5.7.1 - dev: true - - /@changesets/changelog-git@0.1.14: - resolution: {integrity: sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==} - dependencies: - '@changesets/types': 5.2.1 - dev: true - - /@changesets/cli@2.26.1: - resolution: {integrity: sha512-XnTa+b51vt057fyAudvDKGB0Sh72xutQZNAdXkCqPBKO2zvs2yYZx5hFZj1u9cbtpwM6Sxtcr02/FQJfZOzemQ==} - hasBin: true - dependencies: - '@babel/runtime': 7.22.5 - '@changesets/apply-release-plan': 6.1.3 - '@changesets/assemble-release-plan': 5.2.3 - '@changesets/changelog-git': 0.1.14 - '@changesets/config': 2.3.0 - '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.5 - '@changesets/get-release-plan': 3.0.16 - '@changesets/git': 2.0.0 - '@changesets/logger': 0.0.5 - '@changesets/pre': 1.0.14 - '@changesets/read': 0.5.9 - '@changesets/types': 5.2.1 - '@changesets/write': 0.2.3 - '@manypkg/get-packages': 1.1.3 - '@types/is-ci': 3.0.0 - '@types/semver': 6.2.3 - ansi-colors: 4.1.3 - chalk: 2.4.2 - enquirer: 2.3.6 - external-editor: 3.1.0 - fs-extra: 7.0.1 - human-id: 1.0.2 - is-ci: 3.0.1 - meow: 6.1.1 - outdent: 0.5.0 - p-limit: 2.3.0 - preferred-pm: 3.0.3 - resolve-from: 5.0.0 - semver: 5.7.1 - spawndamnit: 2.0.0 - term-size: 2.2.1 - tty-table: 4.2.1 - dev: true - - /@changesets/config@2.3.0: - resolution: {integrity: sha512-EgP/px6mhCx8QeaMAvWtRrgyxW08k/Bx2tpGT+M84jEdX37v3VKfh4Cz1BkwrYKuMV2HZKeHOh8sHvja/HcXfQ==} - dependencies: - '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.5 - '@changesets/logger': 0.0.5 - '@changesets/types': 5.2.1 - '@manypkg/get-packages': 1.1.3 - fs-extra: 7.0.1 - micromatch: 4.0.5 - dev: true - - /@changesets/errors@0.1.4: - resolution: {integrity: sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==} - dependencies: - extendable-error: 0.1.7 - dev: true - - /@changesets/get-dependents-graph@1.3.5: - resolution: {integrity: sha512-w1eEvnWlbVDIY8mWXqWuYE9oKhvIaBhzqzo4ITSJY9hgoqQ3RoBqwlcAzg11qHxv/b8ReDWnMrpjpKrW6m1ZTA==} - dependencies: - '@changesets/types': 5.2.1 - '@manypkg/get-packages': 1.1.3 - chalk: 2.4.2 - fs-extra: 7.0.1 - semver: 5.7.1 - dev: true - - /@changesets/get-release-plan@3.0.16: - resolution: {integrity: sha512-OpP9QILpBp1bY2YNIKFzwigKh7Qe9KizRsZomzLe6pK8IUo8onkAAVUD8+JRKSr8R7d4+JRuQrfSSNlEwKyPYg==} - dependencies: - '@babel/runtime': 7.22.5 - '@changesets/assemble-release-plan': 5.2.3 - '@changesets/config': 2.3.0 - '@changesets/pre': 1.0.14 - '@changesets/read': 0.5.9 - '@changesets/types': 5.2.1 - '@manypkg/get-packages': 1.1.3 - dev: true - - /@changesets/get-version-range-type@0.3.2: - resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} - dev: true - - /@changesets/git@2.0.0: - resolution: {integrity: sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==} - dependencies: - '@babel/runtime': 7.22.5 - '@changesets/errors': 0.1.4 - '@changesets/types': 5.2.1 - '@manypkg/get-packages': 1.1.3 - is-subdir: 1.2.0 - micromatch: 4.0.5 - spawndamnit: 2.0.0 - dev: true - - /@changesets/logger@0.0.5: - resolution: {integrity: sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==} - dependencies: - chalk: 2.4.2 - dev: true - - /@changesets/parse@0.3.16: - resolution: {integrity: sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==} - dependencies: - '@changesets/types': 5.2.1 - js-yaml: 3.14.1 - dev: true - - /@changesets/pre@1.0.14: - resolution: {integrity: sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==} - dependencies: - '@babel/runtime': 7.22.5 - '@changesets/errors': 0.1.4 - '@changesets/types': 5.2.1 - '@manypkg/get-packages': 1.1.3 - fs-extra: 7.0.1 - dev: true - - /@changesets/read@0.5.9: - resolution: {integrity: sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==} - dependencies: - '@babel/runtime': 7.22.5 - '@changesets/git': 2.0.0 - '@changesets/logger': 0.0.5 - '@changesets/parse': 0.3.16 - '@changesets/types': 5.2.1 - chalk: 2.4.2 - fs-extra: 7.0.1 - p-filter: 2.1.0 - dev: true - - /@changesets/types@4.1.0: - resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} - dev: true - - /@changesets/types@5.2.1: - resolution: {integrity: sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==} - dev: true - - /@changesets/write@0.2.3: - resolution: {integrity: sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==} - dependencies: - '@babel/runtime': 7.22.5 - '@changesets/types': 5.2.1 - fs-extra: 7.0.1 - human-id: 1.0.2 - prettier: 2.8.8 - dev: true - - /@cspotcode/source-map-support@0.8.1: - resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} - engines: {node: '>=12'} - dependencies: - '@jridgewell/trace-mapping': 0.3.9 - dev: true - - /@discordjs/collection@1.5.1: - resolution: {integrity: sha512-aWEc9DCf3TMDe9iaJoOnO2+JVAjeRNuRxPZQA6GVvBf+Z3gqUuWYBy2NWh4+5CLYq5uoc3MOvUQ5H5m8CJBqOA==} - engines: {node: '>=16.9.0'} - dev: false - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: false - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: false - - /@emotion/stylis@0.8.5: - resolution: {integrity: sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==} - dev: false - - /@emotion/unitless@0.7.5: - resolution: {integrity: sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==} - dev: false - - /@es-joy/jsdoccomment@0.38.0: - resolution: {integrity: sha512-TFac4Bnv0ZYNkEeDnOWHQhaS1elWlvOCQxH06iHeu5iffs+hCaLVIZJwF+FqksQi68R4i66Pu+4DfFGvble+Uw==} - engines: {node: '>=16'} - dependencies: - comment-parser: 1.3.1 - esquery: 1.5.0 - jsdoc-type-pratt-parser: 4.0.0 - dev: true - - /@eslint-community/eslint-utils@4.4.0(eslint@8.40.0): - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - dependencies: - eslint: 8.40.0 - eslint-visitor-keys: 3.4.1 - dev: true - - /@eslint-community/regexpp@4.5.1: - resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - dev: true - - /@eslint/eslintrc@2.0.3: - resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - ajv: 6.12.6 - debug: 4.3.4(supports-color@5.5.0) - espree: 9.5.2 - globals: 13.20.0 - ignore: 5.2.4 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true - - /@eslint/js@8.40.0: - resolution: {integrity: sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /@fortawesome/fontawesome-common-types@6.4.0: - resolution: {integrity: sha512-HNii132xfomg5QVZw0HwXXpN22s7VBHQBv9CeOu9tfJnhsWQNd2lmTNi8CSrnw5B+5YOmzu1UoPAyxaXsJ6RgQ==} - engines: {node: '>=6'} - requiresBuild: true - dev: false - - /@fortawesome/fontawesome-svg-core@6.4.0: - resolution: {integrity: sha512-Bertv8xOiVELz5raB2FlXDPKt+m94MQ3JgDfsVbrqNpLU9+UE2E18GKjLKw+d3XbeYPqg1pzyQKGsrzbw+pPaw==} - engines: {node: '>=6'} - requiresBuild: true - dependencies: - '@fortawesome/fontawesome-common-types': 6.4.0 - dev: false - - /@fortawesome/free-solid-svg-icons@6.4.0: - resolution: {integrity: sha512-kutPeRGWm8V5dltFP1zGjQOEAzaLZj4StdQhWVZnfGFCvAPVvHh8qk5bRrU4KXnRRRNni5tKQI9PBAdI6MP8nQ==} - engines: {node: '>=6'} - requiresBuild: true - dependencies: - '@fortawesome/fontawesome-common-types': 6.4.0 - dev: false - - /@fortawesome/react-fontawesome@0.2.0(@fortawesome/fontawesome-svg-core@6.4.0)(react@18.2.0): - resolution: {integrity: sha512-uHg75Rb/XORTtVt7OS9WoK8uM276Ufi7gCzshVWkUJbHhh3svsUUeqXerrM96Wm7fRiDzfKRwSoahhMIkGAYHw==} - peerDependencies: - '@fortawesome/fontawesome-svg-core': ~1 || ~6 - react: '>=16.3' - dependencies: - '@fortawesome/fontawesome-svg-core': 6.4.0 - prop-types: 15.8.1 - react: 18.2.0 - dev: false - - /@humanwhocodes/config-array@0.11.10: - resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==} - engines: {node: '>=10.10.0'} - dependencies: - '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.4(supports-color@5.5.0) - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /@humanwhocodes/module-importer@1.0.1: - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} - dev: true - - /@humanwhocodes/object-schema@1.2.1: - resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} - dev: true - - /@isaacs/cliui@8.0.2: - resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} - engines: {node: '>=12'} - dependencies: - string-width: 5.1.2 - string-width-cjs: /string-width@4.2.3 - strip-ansi: 7.1.0 - strip-ansi-cjs: /strip-ansi@6.0.1 - wrap-ansi: 8.1.0 - wrap-ansi-cjs: /wrap-ansi@7.0.0 - dev: true - - /@jridgewell/gen-mapping@0.3.3: - resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} - engines: {node: '>=6.0.0'} - dependencies: - '@jridgewell/set-array': 1.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.18 - - /@jridgewell/resolve-uri@3.1.0: - resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} - engines: {node: '>=6.0.0'} - - /@jridgewell/resolve-uri@3.1.1: - resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} - engines: {node: '>=6.0.0'} - dev: true - - /@jridgewell/set-array@1.1.2: - resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} - engines: {node: '>=6.0.0'} - - /@jridgewell/sourcemap-codec@1.4.14: - resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} - - /@jridgewell/sourcemap-codec@1.4.15: - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - - /@jridgewell/trace-mapping@0.3.18: - resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} - dependencies: - '@jridgewell/resolve-uri': 3.1.0 - '@jridgewell/sourcemap-codec': 1.4.14 - - /@jridgewell/trace-mapping@0.3.9: - resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - dependencies: - '@jridgewell/resolve-uri': 3.1.1 - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - - /@jsdevtools/ono@7.1.3: - resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} - dev: true - - /@manypkg/find-root@1.1.0: - resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} - dependencies: - '@babel/runtime': 7.22.5 - '@types/node': 12.20.55 - find-up: 4.1.0 - fs-extra: 8.1.0 - dev: true - - /@manypkg/get-packages@1.1.3: - resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} - dependencies: - '@babel/runtime': 7.22.5 - '@changesets/types': 4.1.0 - '@manypkg/find-root': 1.1.0 - fs-extra: 8.1.0 - globby: 11.1.0 - read-yaml-file: 1.1.0 - dev: true - - /@microsoft/tsdoc-config@0.16.2: - resolution: {integrity: sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==} - dependencies: - '@microsoft/tsdoc': 0.14.2 - ajv: 6.12.6 - jju: 1.4.0 - resolve: 1.19.0 - dev: true - - /@microsoft/tsdoc@0.14.2: - resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==} - dev: true - - /@next/env@13.4.2: - resolution: {integrity: sha512-Wqvo7lDeS0KGwtwg9TT9wKQ8raelmUxt+TQKWvG/xKfcmDXNOtCuaszcfCF8JzlBG1q0VhpI6CKaRMbVPMDWgw==} - dev: false - - /@next/eslint-plugin-next@13.4.6: - resolution: {integrity: sha512-bPigeu0RI7bgy1ucBA2Yqcfg539y0Lzo38P2hIkrRB1GNvFSbYg6RTu8n6tGqPVrH3TTlPTNKLXG01wc+5NuwQ==} - dependencies: - glob: 7.1.7 - dev: true - - /@next/font@13.4.6: - resolution: {integrity: sha512-Pjm6B6f4KWr4kWe7yu2trLtwQPco/wLSOzWeD7bW17Sd209ibrhRwbSggvlAt1FJu8K4ag2xtVg8WfRFbON1mw==} - dev: false - - /@next/swc-darwin-arm64@13.4.2: - resolution: {integrity: sha512-6BBlqGu3ewgJflv9iLCwO1v1hqlecaIH2AotpKfVUEzUxuuDNJQZ2a4KLb4MBl8T9/vca1YuWhSqtbF6ZuUJJw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@next/swc-darwin-x64@13.4.2: - resolution: {integrity: sha512-iZuYr7ZvGLPjPmfhhMl0ISm+z8EiyLBC1bLyFwGBxkWmPXqdJ60mzuTaDSr5WezDwv0fz32HB7JHmRC6JVHSZg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@next/swc-linux-arm64-gnu@13.4.2: - resolution: {integrity: sha512-2xVabFtIge6BJTcJrW8YuUnYTuQjh4jEuRuS2mscyNVOj6zUZkom3CQg+egKOoS+zh2rrro66ffSKIS+ztFJTg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@next/swc-linux-arm64-musl@13.4.2: - resolution: {integrity: sha512-wKRCQ27xCUJx5d6IivfjYGq8oVngqIhlhSAJntgXLt7Uo9sRT/3EppMHqUZRfyuNBTbykEre1s5166z+pvRB5A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@next/swc-linux-x64-gnu@13.4.2: - resolution: {integrity: sha512-NpCa+UVhhuNeaFVUP1Bftm0uqtvLWq2JTm7+Ta48+2Uqj2mNXrDIvyn1DY/ZEfmW/1yvGBRaUAv9zkMkMRixQA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@next/swc-linux-x64-musl@13.4.2: - resolution: {integrity: sha512-ZWVC72x0lW4aj44e3khvBrj2oSYj1bD0jESmyah3zG/3DplEy/FOtYkMzbMjHTdDSheso7zH8GIlW6CDQnKhmQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@next/swc-win32-arm64-msvc@13.4.2: - resolution: {integrity: sha512-pLT+OWYpzJig5K4VKhLttlIfBcVZfr2+Xbjra0Tjs83NQSkFS+y7xx+YhCwvpEmXYLIvaggj2ONPyjbiigOvHQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: false - optional: true - - /@next/swc-win32-ia32-msvc@13.4.2: - resolution: {integrity: sha512-dhpiksQCyGca4WY0fJyzK3FxMDFoqMb0Cn+uDB+9GYjpU2K5//UGPQlCwiK4JHxuhg8oLMag5Nf3/IPSJNG8jw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: false - optional: true - - /@next/swc-win32-x64-msvc@13.4.2: - resolution: {integrity: sha512-O7bort1Vld00cu8g0jHZq3cbSTUNMohOEvYqsqE10+yfohhdPHzvzO+ziJRz4Dyyr/fYKREwS7gR4JC0soSOMw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: false - optional: true - - /@nodelib/fs.scandir@2.1.5: - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - /@nodelib/fs.stat@2.0.5: - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - /@nodelib/fs.walk@1.2.8: - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.15.0 - - /@npmcli/config@6.2.0: - resolution: {integrity: sha512-lPAPNVUvlv6x0uwGiKzuWVUy1WSBaK5P0t9PoQQVIAbc1RaJLkaNxyUQZOrFJ7Y/ShzLw5skzruThhD9Qcju/A==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - '@npmcli/map-workspaces': 3.0.4 - ini: 4.1.1 - nopt: 7.2.0 - proc-log: 3.0.0 - read-package-json-fast: 3.0.2 - semver: 7.5.3 - walk-up-path: 3.0.1 - dev: true - - /@npmcli/map-workspaces@3.0.4: - resolution: {integrity: sha512-Z0TbvXkRbacjFFLpVpV0e2mheCh+WzQpcqL+4xp49uNJOxOnIAPZyXtUxZ5Qn3QBTGKA11Exjd9a5411rBrhDg==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - '@npmcli/name-from-folder': 2.0.0 - glob: 10.2.7 - minimatch: 9.0.1 - read-package-json-fast: 3.0.2 - dev: true - - /@npmcli/name-from-folder@2.0.0: - resolution: {integrity: sha512-pwK+BfEBZJbKdNYpHHRTNBwBoqrN/iIMO0AiGvYsp3Hoaq0WbgGSWQR6SCldZovoDpY3yje5lkFUe6gsDgJ2vg==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: true - - /@pkgjs/parseargs@0.11.0: - resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} - engines: {node: '>=14'} - requiresBuild: true - dev: true - optional: true - - /@pkgr/utils@2.4.1: - resolution: {integrity: sha512-JOqwkgFEyi+OROIyq7l4Jy28h/WwhDnG/cPkXG2Z1iFbubB6jsHW1NDvmyOzTBxHr3yg68YGirmh1JUgMqa+9w==} - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - dependencies: - cross-spawn: 7.0.3 - fast-glob: 3.2.12 - is-glob: 4.0.3 - open: 9.1.0 - picocolors: 1.0.0 - tslib: 2.5.3 - dev: true - - /@rushstack/eslint-patch@1.3.2: - resolution: {integrity: sha512-V+MvGwaHH03hYhY+k6Ef/xKd6RYlc4q8WBx+2ANmipHJcKuktNcI/NgEsJgdSUF6Lw32njT6OnrRsKYCdgHjYw==} - dev: true - - /@swc/helpers@0.5.1: - resolution: {integrity: sha512-sJ902EfIzn1Fa+qYmjdQqh8tPsoxyBz+8yBKC2HKUxyezKJFwPGOn7pv4WY6QuQW//ySQi5lJjA/ZT9sNWWNTg==} - dependencies: - tslib: 2.5.3 - dev: false - - /@tsconfig/node10@1.0.9: - resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} - dev: true - - /@tsconfig/node12@1.0.11: - resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} - dev: true - - /@tsconfig/node14@1.0.3: - resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} - dev: true - - /@tsconfig/node16@1.0.4: - resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} - dev: true - - /@types/acorn@4.0.6: - resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} - dependencies: - '@types/estree': 1.0.1 - dev: true - - /@types/concat-stream@2.0.0: - resolution: {integrity: sha512-t3YCerNM7NTVjLuICZo5gYAXYoDvpuuTceCcFQWcDQz26kxUR5uIWolxbIR5jRNIXpMqhOpW/b8imCR1LEmuJw==} - dependencies: - '@types/node': 18.16.12 - dev: true - - /@types/debug@4.1.8: - resolution: {integrity: sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==} - dependencies: - '@types/ms': 0.7.31 - dev: true - - /@types/estree-jsx@1.0.0: - resolution: {integrity: sha512-3qvGd0z8F2ENTGr/GG1yViqfiKmRfrXVx5sJyHGFu3z7m5g5utCQtGp/g29JnjflhtQJBv1WDQukHiT58xPcYQ==} - dependencies: - '@types/estree': 1.0.1 - dev: true - - /@types/estree@1.0.1: - resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} - dev: true - - /@types/fs-extra@11.0.1: - resolution: {integrity: sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==} - dependencies: - '@types/jsonfile': 6.1.1 - '@types/node': 20.3.1 - dev: true - - /@types/hast@2.3.4: - resolution: {integrity: sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g==} - dependencies: - '@types/unist': 2.0.6 - dev: true - - /@types/is-ci@3.0.0: - resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} - dependencies: - ci-info: 3.8.0 - dev: true - - /@types/is-empty@1.2.1: - resolution: {integrity: sha512-a3xgqnFTuNJDm1fjsTjHocYJ40Cz3t8utYpi5GNaxzrJC2HSD08ym+whIL7fNqiqBCdM9bcqD1H/tORWAFXoZw==} - dev: true - - /@types/json-schema@7.0.12: - resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} - dev: true - - /@types/jsonfile@6.1.1: - resolution: {integrity: sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==} - dependencies: - '@types/node': 18.16.12 - dev: true - - /@types/mdast@3.0.11: - resolution: {integrity: sha512-Y/uImid8aAwrEA24/1tcRZwpxX3pIFTSilcNDKSPn+Y2iDywSEachzRuvgAYYLR3wpGXAsMbv5lvKLDZLeYPAw==} - dependencies: - '@types/unist': 2.0.6 - dev: true - - /@types/minimist@1.2.2: - resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} - dev: true - - /@types/ms@0.7.31: - resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==} - dev: true - - /@types/node-fetch@2.6.4: - resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} - dependencies: - '@types/node': 20.3.1 - form-data: 3.0.1 - dev: true - - /@types/node@12.20.55: - resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} - dev: true - - /@types/node@18.16.12: - resolution: {integrity: sha512-tIRrjbY9C277MOfP8M3zjMIhtMlUJ6YVqkGgLjz+74jVsdf4/UjC6Hku4+1N0BS0qyC0JAS6tJLUk9H6JUKviQ==} - dev: true - - /@types/node@20.3.1: - resolution: {integrity: sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==} - - /@types/normalize-package-data@2.4.1: - resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} - dev: true - - /@types/prop-types@15.7.5: - resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} - dev: true - - /@types/qs@6.9.7: - resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} - dev: true - - /@types/react-dom@18.2.4: - resolution: {integrity: sha512-G2mHoTMTL4yoydITgOGwWdWMVd8sNgyEP85xVmMKAPUBwQWm9wBPQUmvbeF4V3WBY1P7mmL4BkjQ0SqUpf1snw==} - dependencies: - '@types/react': 18.2.6 - dev: true - - /@types/react@18.2.6: - resolution: {integrity: sha512-wRZClXn//zxCFW+ye/D2qY65UsYP1Fpex2YXorHc8awoNamkMZSvBxwxdYVInsHOZZd2Ppq8isnSzJL5Mpf8OA==} - dependencies: - '@types/prop-types': 15.7.5 - '@types/scheduler': 0.16.3 - csstype: 3.1.2 - dev: true - - /@types/scheduler@0.16.3: - resolution: {integrity: sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==} - dev: true - - /@types/semver@6.2.3: - resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} - dev: true - - /@types/semver@7.5.0: - resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} - dev: true - - /@types/supports-color@8.1.1: - resolution: {integrity: sha512-dPWnWsf+kzIG140B8z2w3fr5D03TLWbOAFQl45xUpI3vcizeXriNR5VYkWZ+WTMsUHqZ9Xlt3hrxGNANFyNQfw==} - dev: true - - /@types/unist@2.0.6: - resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} - dev: true - - /@types/ws@8.5.4: - resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==} - dependencies: - '@types/node': 20.3.1 - dev: false - - /@types/yargs-interactive@2.1.3: - resolution: {integrity: sha512-bYB8ah0JPR6/lpHlxUzeHsrb3RK5OW7N8Hnth2nefnr6zQ5KFoDQ6wM5x58dTLEDYrwikFy3EPTf/O0HKLNaIg==} - dependencies: - '@types/yargs': 17.0.24 - dev: false - - /@types/yargs-parser@21.0.0: - resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} - - /@types/yargs@17.0.24: - resolution: {integrity: sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==} - dependencies: - '@types/yargs-parser': 21.0.0 - - /@typescript-eslint/eslint-plugin@5.60.0(@typescript-eslint/parser@5.60.0)(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-78B+anHLF1TI8Jn/cD0Q00TBYdMgjdOn980JfAVa9yw5sop8nyTfVOQAv6LWywkOGLclDBtv5z3oxN4w7jxyNg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/scope-manager': 5.60.0 - '@typescript-eslint/type-utils': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/utils': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.40.0 - grapheme-splitter: 1.0.4 - ignore: 5.2.4 - natural-compare-lite: 1.4.0 - semver: 7.5.2 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/experimental-utils@5.60.0(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-ovid3u7CNBrr0Ct35LUPkNYH4e+z4Kc6dPfSG99oMmH9SfoEoefq09uSnJI4mUb/UM7a/peVM03G+MzLxrD16g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@typescript-eslint/utils': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - eslint: 8.40.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/parser@5.60.0(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-jBONcBsDJ9UoTWrARkRRCgDz6wUggmH5RpQVlt7BimSwaTkTjwypGzKORXbR4/2Hqjk9hgwlon2rVQAjWNpkyQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/scope-manager': 5.60.0 - '@typescript-eslint/types': 5.60.0 - '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.0.4) - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.40.0 - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/scope-manager@5.59.7: - resolution: {integrity: sha512-FL6hkYWK9zBGdxT2wWEd2W8ocXMu3K94i3gvMrjXpx+koFYdYV7KprKfirpgY34vTGzEPPuKoERpP8kD5h7vZQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.59.7 - '@typescript-eslint/visitor-keys': 5.59.7 - dev: true - - /@typescript-eslint/scope-manager@5.60.0: - resolution: {integrity: sha512-hakuzcxPwXi2ihf9WQu1BbRj1e/Pd8ZZwVTG9kfbxAMZstKz8/9OoexIwnmLzShtsdap5U/CoQGRCWlSuPbYxQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.60.0 - '@typescript-eslint/visitor-keys': 5.60.0 - dev: true - - /@typescript-eslint/type-utils@5.59.7(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-ozuz/GILuYG7osdY5O5yg0QxXUAEoI4Go3Do5xeu+ERH9PorHBPSdvD3Tjp2NN2bNLh1NJQSsQu2TPu/Ly+HaQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: '*' - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 5.59.7(typescript@5.0.4) - '@typescript-eslint/utils': 5.59.7(eslint@8.40.0)(typescript@5.0.4) - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.40.0 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/type-utils@5.60.0(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-X7NsRQddORMYRFH7FWo6sA9Y/zbJ8s1x1RIAtnlj6YprbToTiQnM6vxcMu7iYhdunmoC0rUWlca13D5DVHkK2g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: '*' - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.0.4) - '@typescript-eslint/utils': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.40.0 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/types@5.59.7: - resolution: {integrity: sha512-UnVS2MRRg6p7xOSATscWkKjlf/NDKuqo5TdbWck6rIRZbmKpVNTLALzNvcjIfHBE7736kZOFc/4Z3VcZwuOM/A==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /@typescript-eslint/types@5.60.0: - resolution: {integrity: sha512-ascOuoCpNZBccFVNJRSC6rPq4EmJ2NkuoKnd6LDNyAQmdDnziAtxbCGWCbefG1CNzmDvd05zO36AmB7H8RzKPA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /@typescript-eslint/typescript-estree@5.59.7(typescript@5.0.4): - resolution: {integrity: sha512-4A1NtZ1I3wMN2UGDkU9HMBL+TIQfbrh4uS0WDMMpf3xMRursDbqEf1ahh6vAAe3mObt8k3ZATnezwG4pdtWuUQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 5.59.7 - '@typescript-eslint/visitor-keys': 5.59.7 - debug: 4.3.4(supports-color@5.5.0) - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.5.3 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/typescript-estree@5.60.0(typescript@5.0.4): - resolution: {integrity: sha512-R43thAuwarC99SnvrBmh26tc7F6sPa2B3evkXp/8q954kYL6Ro56AwASYWtEEi+4j09GbiNAHqYwNNZuNlARGQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 5.60.0 - '@typescript-eslint/visitor-keys': 5.60.0 - debug: 4.3.4(supports-color@5.5.0) - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.5.3 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/utils@5.59.7(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-yCX9WpdQKaLufz5luG4aJbOpdXf/fjwGMcLFXZVPUz3QqLirG5QcwwnIHNf8cjLjxK4qtzTO8udUtMQSAToQnQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - '@types/json-schema': 7.0.12 - '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.59.7 - '@typescript-eslint/types': 5.59.7 - '@typescript-eslint/typescript-estree': 5.59.7(typescript@5.0.4) - eslint: 8.40.0 - eslint-scope: 5.1.1 - semver: 7.5.3 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/utils@5.60.0(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-ba51uMqDtfLQ5+xHtwlO84vkdjrqNzOnqrnwbMHMRY8Tqeme8C2Q8Fc7LajfGR+e3/4LoYiWXUM6BpIIbHJ4hQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - '@types/json-schema': 7.0.12 - '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.60.0 - '@typescript-eslint/types': 5.60.0 - '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.0.4) - eslint: 8.40.0 - eslint-scope: 5.1.1 - semver: 7.5.3 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/visitor-keys@5.59.7: - resolution: {integrity: sha512-tyN+X2jvMslUszIiYbF0ZleP+RqQsFVpGrKI6e0Eet1w8WmhsAtmzaqm8oM8WJQ1ysLwhnsK/4hYHJjOgJVfQQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.59.7 - eslint-visitor-keys: 3.4.1 - dev: true - - /@typescript-eslint/visitor-keys@5.60.0: - resolution: {integrity: sha512-wm9Uz71SbCyhUKgcaPRauBdTegUyY/ZWl8gLwD/i/ybJqscrrdVSFImpvUz16BLPChIeKBK5Fa9s6KDQjsjyWw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.60.0 - eslint-visitor-keys: 3.4.1 - dev: true - - /abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - dev: true - - /abbrev@2.0.0: - resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: true - - /abind@1.0.5: - resolution: {integrity: sha512-dbaEZphdPje0ihqSdWg36Sb8S20TuqQomiz2593oIx+enQ9Q4vDZRjIzhnkWltGRKVKqC28kTribkgRLBexWVQ==} - engines: {node: '>=6', npm: '>=3'} - dev: false - - /acorn-jsx@5.3.2(acorn@8.9.0): - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - acorn: 8.9.0 - dev: true - - /acorn-walk@8.2.0: - resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} - engines: {node: '>=0.4.0'} - dev: true - - /acorn@8.9.0: - resolution: {integrity: sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: true - - /aggregate-error@3.1.0: - resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} - engines: {node: '>=8'} - dependencies: - clean-stack: 2.2.0 - indent-string: 4.0.0 - dev: true - - /ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - dev: true - - /ansi-colors@4.1.3: - resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} - engines: {node: '>=6'} - dev: true - - /ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.21.3 - - /ansi-regex@2.1.1: - resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} - engines: {node: '>=0.10.0'} - dev: false - - /ansi-regex@4.1.1: - resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==} - engines: {node: '>=6'} - dev: false - - /ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - /ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - dev: true - - /ansi-sequence-parser@1.1.0: - resolution: {integrity: sha512-lEm8mt52to2fT8GhciPCGeCXACSz2UwIN4X2e2LJSnZ5uAbn2/dsYdOmUXq0AtWS5cpAupysIneExOgH0Vd2TQ==} - dev: true - - /ansi-styles@3.2.1: - resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} - engines: {node: '>=4'} - dependencies: - color-convert: 1.9.3 - - /ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - dependencies: - color-convert: 2.0.1 - - /ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - dev: true - - /any-promise@1.3.0: - resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - dev: true - - /anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - dev: true - - /are-docs-informative@0.0.2: - resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} - engines: {node: '>=14'} - dev: true - - /arg@4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} - dev: true - - /arg@5.0.2: - resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} - dev: true - - /argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - dependencies: - sprintf-js: 1.0.3 - dev: true - - /argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - dev: true - - /argx@3.0.2: - resolution: {integrity: sha512-PUyi1r14HG1AH6raqPEW8+vKNWfvHrmerdBXnf5iz7JOnO1hRaG1cGsH9eay/y8dUIreN7NxSEfK208UCGd0wQ==} - engines: {node: '>=4', npm: '>=2'} - dependencies: - iftype: 3.0.2 - dev: false - - /argx@4.0.4: - resolution: {integrity: sha512-XLWeRTNBJRzQkbMweLIxdtnvpE7iYUBraPwrIJX57FjL4D1RHLMJRM1AyEP6KZHgvjW7TSnxF8MpGic7YdTGOA==} - engines: {node: '>=8', npm: '>=5'} - dependencies: - iftype: 4.0.9 - dev: false - - /aria-query@5.1.3: - resolution: {integrity: sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==} - dependencies: - deep-equal: 2.2.1 - dev: true - - /aria-query@5.2.1: - resolution: {integrity: sha512-7uFg4b+lETFgdaJyETnILsXgnnzVnkHcgRbwbPwevm5x/LmUlt3MjczMRe1zg824iBgXZNRPTBftNYyRSKLp2g==} - dependencies: - dequal: 2.0.3 - dev: true - - /array-buffer-byte-length@1.0.0: - resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} - dependencies: - call-bind: 1.0.2 - is-array-buffer: 3.0.2 - dev: true - - /array-includes@3.1.6: - resolution: {integrity: sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - get-intrinsic: 1.2.1 - is-string: 1.0.7 - dev: true - - /array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} - - /array.prototype.flat@1.3.1: - resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - es-shim-unscopables: 1.0.0 - dev: true - - /array.prototype.flatmap@1.3.1: - resolution: {integrity: sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - es-shim-unscopables: 1.0.0 - dev: true - - /array.prototype.tosorted@1.1.1: - resolution: {integrity: sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - es-shim-unscopables: 1.0.0 - get-intrinsic: 1.2.1 - dev: true - - /arrayreduce@2.1.0: - resolution: {integrity: sha512-I5MwrsPJ4faMuuPXM8+EgEy83G16i+FqegFhhHX3geDJbyaqPDWNrVjkrRg9SZq5mepEZdNg36SDPOhiKPWTLA==} - engines: {node: '>=4.0.0'} - dev: false - - /arrify@1.0.1: - resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} - engines: {node: '>=0.10.0'} - dev: true - - /askconfig@4.0.4: - resolution: {integrity: sha512-fjB/vmAlUKxGVqcz4mLub3xF8m9rkazhqcXRvrDzeey0iaLhcAg2K8bhJL7pKjE2dFP9qDGv3+yXovYMV9XBJQ==} - engines: {node: '>=8', npm: '>=5'} - dependencies: - argx: 4.0.4 - cli-color: 1.4.0 - objnest: 5.1.1 - dev: false - - /assert@1.5.0: - resolution: {integrity: sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==} - dependencies: - object-assign: 4.1.1 - util: 0.10.3 - dev: true - - /ast-types-flow@0.0.7: - resolution: {integrity: sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==} - dev: true - - /astral-regex@2.0.0: - resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} - engines: {node: '>=8'} - dev: true - - /astro-eslint-parser@0.13.3: - resolution: {integrity: sha512-n+fb6O40SM6sD36lGwgVIE3zeVQUMdl6ZHaHEjRI4zdaBu658XaAV1YDztF7Iga5kmeOxJYB87mcQ+lUnQs0Nw==} - engines: {node: ^14.18.0 || >=16.0.0} - dependencies: - '@astrojs/compiler': 1.5.1 - '@typescript-eslint/scope-manager': 5.60.0 - '@typescript-eslint/types': 5.60.0 - astrojs-compiler-sync: 0.3.3(@astrojs/compiler@1.5.1) - debug: 4.3.4(supports-color@5.5.0) - eslint-visitor-keys: 3.4.1 - espree: 9.5.2 - semver: 7.5.2 - transitivePeerDependencies: - - supports-color - dev: true - - /astrojs-compiler-sync@0.3.3(@astrojs/compiler@1.5.1): - resolution: {integrity: sha512-LbhchWgsvjvRBb5n5ez8/Q/f9ZKViuox27VxMDOdTUm8MRv9U7phzOiLue5KluqTmC0z1LId4gY2SekvoDrkuw==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - '@astrojs/compiler': '>=0.27.0' - dependencies: - '@astrojs/compiler': 1.5.1 - synckit: 0.8.5 - dev: true - - /async@1.5.2: - resolution: {integrity: sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==} - dev: false - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - /autoprefixer@10.4.14(postcss@8.4.24): - resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==} - engines: {node: ^10 || ^12 || >=14} - hasBin: true - peerDependencies: - postcss: ^8.1.0 - dependencies: - browserslist: 4.21.9 - caniuse-lite: 1.0.30001505 - fraction.js: 4.2.0 - normalize-range: 0.1.2 - picocolors: 1.0.0 - postcss: 8.4.24 - postcss-value-parser: 4.2.0 - dev: true - - /available-typed-arrays@1.0.5: - resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} - engines: {node: '>= 0.4'} - dev: true - - /axe-core@4.7.2: - resolution: {integrity: sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g==} - engines: {node: '>=4'} - dev: true - - /axobject-query@3.1.1: - resolution: {integrity: sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==} - dependencies: - deep-equal: 2.2.1 - dev: true - - /axobject-query@3.2.1: - resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==} - dependencies: - dequal: 2.0.3 - dev: true - - /babel-plugin-styled-components@2.1.3(styled-components@5.3.11): - resolution: {integrity: sha512-jBioLwBVHpOMU4NsueH/ADcHrjS0Y/WTpt2eGVmmuSFNEv2DF3XhcMncuZlbbjxQ4vzxg+yEr6E6TNjrIQbsJQ==} - peerDependencies: - styled-components: '>= 2' - dependencies: - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-module-imports': 7.22.5 - babel-plugin-syntax-jsx: 6.18.0 - lodash: 4.17.21 - picomatch: 2.3.1 - styled-components: 5.3.11(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0) - dev: false - - /babel-plugin-syntax-jsx@6.18.0: - resolution: {integrity: sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==} - dev: false - - /babel-runtime@6.26.0: - resolution: {integrity: sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==} - dependencies: - core-js: 2.6.12 - regenerator-runtime: 0.11.1 - dev: false - - /bail@2.0.2: - resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} - dev: true - - /balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - dev: true - - /bent@7.3.12: - resolution: {integrity: sha512-T3yrKnVGB63zRuoco/7Ybl7BwwGZR0lceoVG5XmQyMIH9s19SV5m+a8qam4if0zQuAmOQTyPTPmsQBdAorGK3w==} - dependencies: - bytesish: 0.4.4 - caseless: 0.12.0 - is-stream: 2.0.1 - dev: true - - /better-path-resolve@1.0.0: - resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} - engines: {node: '>=4'} - dependencies: - is-windows: 1.0.2 - dev: true - - /big-integer@1.6.51: - resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==} - engines: {node: '>=0.6'} - dev: true - - /binary-extensions@2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} - engines: {node: '>=8'} - dev: true - - /boolbase@1.0.0: - resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} - dev: true - - /bplist-parser@0.2.0: - resolution: {integrity: sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==} - engines: {node: '>= 5.10.0'} - dependencies: - big-integer: 1.6.51 - dev: true - - /brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - dev: true - - /brace-expansion@2.0.1: - resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} - dependencies: - balanced-match: 1.0.2 - dev: true - - /braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - dependencies: - fill-range: 7.0.1 - - /breakword@1.0.6: - resolution: {integrity: sha512-yjxDAYyK/pBvws9H4xKYpLDpYKEH6CzrBPAuXq3x18I+c/2MkVtT3qAr7Oloi6Dss9qNhPVueAAVU1CSeNDIXw==} - dependencies: - wcwidth: 1.0.1 - dev: true - - /browserslist@4.21.9: - resolution: {integrity: sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - dependencies: - caniuse-lite: 1.0.30001505 - electron-to-chromium: 1.4.435 - node-releases: 2.0.12 - update-browserslist-db: 1.0.11(browserslist@4.21.9) - dev: true - - /buffer-from@1.1.2: - resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - dev: true - - /builtin-modules@3.3.0: - resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} - engines: {node: '>=6'} - dev: true - - /builtins@5.0.1: - resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} - dependencies: - semver: 7.5.3 - dev: true - - /bundle-name@3.0.0: - resolution: {integrity: sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==} - engines: {node: '>=12'} - dependencies: - run-applescript: 5.0.0 - dev: true - - /busboy@1.6.0: - resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} - engines: {node: '>=10.16.0'} - dependencies: - streamsearch: 1.1.0 - - /bytesish@0.4.4: - resolution: {integrity: sha512-i4uu6M4zuMUiyfZN4RU2+i9+peJh//pXhd9x1oSe1LBkZ3LEbCoygu8W0bXTukU1Jme2txKuotpCZRaC3FLxcQ==} - dev: true - - /call-bind@1.0.2: - resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} - dependencies: - function-bind: 1.1.1 - get-intrinsic: 1.2.1 - - /call-me-maybe@1.0.2: - resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} - dev: true - - /callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - dev: true - - /camelcase-css@2.0.1: - resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} - engines: {node: '>= 6'} - dev: true - - /camelcase-keys@6.2.2: - resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} - engines: {node: '>=8'} - dependencies: - camelcase: 5.3.1 - map-obj: 4.3.0 - quick-lru: 4.0.1 - dev: true - - /camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - - /camelcase@6.3.0: - resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} - engines: {node: '>=10'} - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: false - - /caniuse-lite@1.0.30001505: - resolution: {integrity: sha512-jaAOR5zVtxHfL0NjZyflVTtXm3D3J9P15zSJ7HmQF8dSKGA6tqzQq+0ZI3xkjyQj46I4/M0K2GbMpcAFOcbr3A==} - - /caseless@0.12.0: - resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} - dev: true - - /ccount@2.0.1: - resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} - dev: true - - /chalk@2.4.2: - resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} - engines: {node: '>=4'} - dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 - - /chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - /chalk@5.2.0: - resolution: {integrity: sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - dev: true - - /character-entities-html4@2.1.0: - resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} - dev: true - - /character-entities-legacy@1.1.4: - resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} - - /character-entities-legacy@3.0.0: - resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} - dev: true - - /character-entities@1.2.4: - resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} - - /character-entities@2.0.2: - resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} - dev: true - - /character-reference-invalid@1.1.4: - resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} - - /character-reference-invalid@2.0.1: - resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} - dev: true - - /chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - /chokidar@3.5.3: - resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} - engines: {node: '>= 8.10.0'} - dependencies: - anymatch: 3.1.3 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.2 - dev: true - - /ci-info@3.8.0: - resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} - engines: {node: '>=8'} - dev: true - - /clean-regexp@1.0.0: - resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==} - engines: {node: '>=4'} - dependencies: - escape-string-regexp: 1.0.5 - dev: true - - /clean-stack@2.2.0: - resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} - engines: {node: '>=6'} - dev: true - - /cli-color@1.4.0: - resolution: {integrity: sha512-xu6RvQqqrWEo6MPR1eixqGPywhYBHRs653F9jfXB2Hx4jdM/3WxiNE1vppRmxtMIfl16SFYTpYlrnqH/HsK/2w==} - dependencies: - ansi-regex: 2.1.1 - d: 1.0.1 - es5-ext: 0.10.62 - es6-iterator: 2.0.3 - memoizee: 0.4.15 - timers-ext: 0.1.7 - dev: false - - /cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - dependencies: - restore-cursor: 3.1.0 - - /cli-truncate@2.1.0: - resolution: {integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==} - engines: {node: '>=8'} - dependencies: - slice-ansi: 3.0.0 - string-width: 4.2.3 - dev: true - - /cli-truncate@3.1.0: - resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - slice-ansi: 5.0.0 - string-width: 5.1.2 - dev: true - - /cli-width@3.0.0: - resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} - engines: {node: '>= 10'} - dev: false - - /client-only@0.0.1: - resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} - dev: false - - /clipboard@2.0.11: - resolution: {integrity: sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==} - requiresBuild: true - dependencies: - good-listener: 1.2.2 - select: 1.1.2 - tiny-emitter: 2.1.0 - dev: false - optional: true - - /cliui@5.0.0: - resolution: {integrity: sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==} - dependencies: - string-width: 3.1.0 - strip-ansi: 5.2.0 - wrap-ansi: 5.1.0 - dev: false - - /cliui@6.0.0: - resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - dev: true - - /cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - dev: true - - /clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - dev: true - - /co@4.6.0: - resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} - engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - dev: false - - /color-convert@1.9.3: - resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} - dependencies: - color-name: 1.1.3 - - /color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - dependencies: - color-name: 1.1.4 - - /color-name@1.1.3: - resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - - /color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - /colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - - /comma-separated-tokens@1.0.8: - resolution: {integrity: sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==} - dev: false - - /commander@10.0.1: - resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} - engines: {node: '>=14'} - dev: true - - /commander@4.1.1: - resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} - engines: {node: '>= 6'} - dev: true - - /comment-parser@1.3.1: - resolution: {integrity: sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==} - engines: {node: '>= 12.0.0'} - dev: true - - /common-tags@1.8.2: - resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} - engines: {node: '>=4.0.0'} - dev: true - - /concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - dev: true - - /concat-stream@2.0.0: - resolution: {integrity: sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==} - engines: {'0': node >= 6.0} - dependencies: - buffer-from: 1.1.2 - inherits: 2.0.4 - readable-stream: 3.6.2 - typedarray: 0.0.6 - dev: true - - /core-js@2.6.12: - resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} - deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. - requiresBuild: true - dev: false - - /create-create-app@7.3.0: - resolution: {integrity: sha512-4BzSuq75JihB3hvFQHu1mqPDLUBcR3u5N9yShG6LSv84O7NjTNc/hE+cgDlSJZzfgr7LRahtI5FwPxLyVi/oPg==} - hasBin: true - dependencies: - '@types/yargs-interactive': 2.1.3 - chalk: 4.1.2 - cross-spawn: 7.0.3 - epicfail: 3.0.0 - execa: 5.1.1 - gitconfig: 2.0.8 - globby: 11.1.0 - handlebars: 4.7.7 - is-utf8: 0.2.1 - license.js: 3.1.2 - slash: 3.0.0 - uuid: 8.3.2 - yargs-interactive: 3.0.1 - transitivePeerDependencies: - - encoding - dev: false - - /create-require@1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - dev: true - - /cross-spawn@5.1.0: - resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} - dependencies: - lru-cache: 4.1.5 - shebang-command: 1.2.0 - which: 1.3.1 - dev: true - - /cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} - engines: {node: '>= 8'} - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: false - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: false - - /cssesc@3.0.0: - resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} - engines: {node: '>=4'} - hasBin: true - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /csv-generate@3.4.3: - resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} - dev: true - - /csv-parse@4.16.3: - resolution: {integrity: sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==} - dev: true - - /csv-stringify@5.6.5: - resolution: {integrity: sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==} - dev: true - - /csv@5.5.3: - resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} - engines: {node: '>= 0.1.90'} - dependencies: - csv-generate: 3.4.3 - csv-parse: 4.16.3 - csv-stringify: 5.6.5 - stream-transform: 2.1.3 - dev: true - - /d@1.0.1: - resolution: {integrity: sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==} - dependencies: - es5-ext: 0.10.62 - type: 1.2.0 - dev: false - - /damerau-levenshtein@1.0.8: - resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} - dev: true - - /debug@3.2.7(supports-color@5.5.0): - resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.3 - supports-color: 5.5.0 - dev: true - - /debug@4.3.4(supports-color@5.5.0): - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - supports-color: 5.5.0 - - /decamelize-keys@1.1.1: - resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} - engines: {node: '>=0.10.0'} - dependencies: - decamelize: 1.2.0 - map-obj: 1.0.1 - dev: true - - /decamelize@1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} - - /decamelize@5.0.1: - resolution: {integrity: sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==} - engines: {node: '>=10'} - dev: true - - /decode-named-character-reference@1.0.2: - resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} - dependencies: - character-entities: 2.0.2 - dev: true - - /deep-equal@2.2.1: - resolution: {integrity: sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==} - dependencies: - array-buffer-byte-length: 1.0.0 - call-bind: 1.0.2 - es-get-iterator: 1.1.3 - get-intrinsic: 1.2.1 - is-arguments: 1.1.1 - is-array-buffer: 3.0.2 - is-date-object: 1.0.5 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.2 - isarray: 2.0.5 - object-is: 1.1.5 - object-keys: 1.1.1 - object.assign: 4.1.4 - regexp.prototype.flags: 1.5.0 - side-channel: 1.0.4 - which-boxed-primitive: 1.0.2 - which-collection: 1.0.1 - which-typed-array: 1.1.9 - dev: true - - /deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - dev: true - - /default-browser-id@3.0.0: - resolution: {integrity: sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==} - engines: {node: '>=12'} - dependencies: - bplist-parser: 0.2.0 - untildify: 4.0.0 - dev: true - - /default-browser@4.0.0: - resolution: {integrity: sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==} - engines: {node: '>=14.16'} - dependencies: - bundle-name: 3.0.0 - default-browser-id: 3.0.0 - execa: 7.1.1 - titleize: 3.0.0 - dev: true - - /defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - dependencies: - clone: 1.0.4 - dev: true - - /define-lazy-prop@3.0.0: - resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} - engines: {node: '>=12'} - dev: true - - /define-properties@1.2.0: - resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} - engines: {node: '>= 0.4'} - dependencies: - has-property-descriptors: 1.0.0 - object-keys: 1.1.1 - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - /delegate@3.2.0: - resolution: {integrity: sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==} - dev: false - optional: true - - /dequal@2.0.3: - resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} - engines: {node: '>=6'} - dev: true - - /detect-indent@6.1.0: - resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} - engines: {node: '>=8'} - dev: true - - /didyoumean@1.2.2: - resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} - dev: true - - /diff@4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} - dev: true - - /diff@5.1.0: - resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} - engines: {node: '>=0.3.1'} - dev: true - - /dir-glob@3.0.1: - resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} - engines: {node: '>=8'} - dependencies: - path-type: 4.0.0 - - /dlv@1.1.3: - resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} - dev: true - - /doctrine@2.1.0: - resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} - engines: {node: '>=0.10.0'} - dependencies: - esutils: 2.0.3 - dev: true - - /doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - dependencies: - esutils: 2.0.3 - dev: true - - /dotenv@16.0.3: - resolution: {integrity: sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==} - engines: {node: '>=12'} - dev: true - - /dotenv@16.3.1: - resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} - engines: {node: '>=12'} - - /eastasianwidth@0.2.0: - resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - dev: true - - /electron-to-chromium@1.4.435: - resolution: {integrity: sha512-B0CBWVFhvoQCW/XtjRzgrmqcgVWg6RXOEM/dK59+wFV93BFGR6AeNKc4OyhM+T3IhJaOOG8o/V+33Y2mwJWtzw==} - dev: true - - /emoji-regex@7.0.3: - resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} - dev: false - - /emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - /emoji-regex@9.2.2: - resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - dev: true - - /enhanced-resolve@5.15.0: - resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==} - engines: {node: '>=10.13.0'} - dependencies: - graceful-fs: 4.2.11 - tapable: 2.2.1 - dev: true - - /enquirer@2.3.6: - resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} - engines: {node: '>=8.6'} - dependencies: - ansi-colors: 4.1.3 - dev: true - - /envinfo@7.10.0: - resolution: {integrity: sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw==} - engines: {node: '>=4'} - hasBin: true - dev: false - - /epicfail@3.0.0: - resolution: {integrity: sha512-zf7vvWZ2tI2+P1674dmcyPWopD/0FC2BrAi0DvDY0uKGmrB66rwpRVlOYKFlGwRO4Q6bpkoCTPhjqvi5hMOavQ==} - dependencies: - chalk: 4.1.2 - envinfo: 7.10.0 - node-fetch: 2.6.11 - pkg-up: 3.1.0 - transitivePeerDependencies: - - encoding - dev: false - - /error-ex@1.3.2: - resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - dependencies: - is-arrayish: 0.2.1 - dev: true - - /es-abstract@1.21.2: - resolution: {integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.0 - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - es-set-tostringtag: 2.0.1 - es-to-primitive: 1.2.1 - function.prototype.name: 1.1.5 - get-intrinsic: 1.2.1 - get-symbol-description: 1.0.0 - globalthis: 1.0.3 - gopd: 1.0.1 - has: 1.0.3 - has-property-descriptors: 1.0.0 - has-proto: 1.0.1 - has-symbols: 1.0.3 - internal-slot: 1.0.5 - is-array-buffer: 3.0.2 - is-callable: 1.2.7 - is-negative-zero: 2.0.2 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.2 - is-string: 1.0.7 - is-typed-array: 1.1.10 - is-weakref: 1.0.2 - object-inspect: 1.12.3 - object-keys: 1.1.1 - object.assign: 4.1.4 - regexp.prototype.flags: 1.5.0 - safe-regex-test: 1.0.0 - string.prototype.trim: 1.2.7 - string.prototype.trimend: 1.0.6 - string.prototype.trimstart: 1.0.6 - typed-array-length: 1.0.4 - unbox-primitive: 1.0.2 - which-typed-array: 1.1.9 - dev: true - - /es-get-iterator@1.1.3: - resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.1 - has-symbols: 1.0.3 - is-arguments: 1.1.1 - is-map: 2.0.2 - is-set: 2.0.2 - is-string: 1.0.7 - isarray: 2.0.5 - stop-iteration-iterator: 1.0.0 - dev: true - - /es-set-tostringtag@2.0.1: - resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.1 - has: 1.0.3 - has-tostringtag: 1.0.0 - dev: true - - /es-shim-unscopables@1.0.0: - resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} - dependencies: - has: 1.0.3 - dev: true - - /es-to-primitive@1.2.1: - resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} - engines: {node: '>= 0.4'} - dependencies: - is-callable: 1.2.7 - is-date-object: 1.0.5 - is-symbol: 1.0.4 - dev: true - - /es5-ext@0.10.62: - resolution: {integrity: sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==} - engines: {node: '>=0.10'} - requiresBuild: true - dependencies: - es6-iterator: 2.0.3 - es6-symbol: 3.1.3 - next-tick: 1.1.0 - dev: false - - /es6-iterator@2.0.3: - resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} - dependencies: - d: 1.0.1 - es5-ext: 0.10.62 - es6-symbol: 3.1.3 - dev: false - - /es6-symbol@3.1.3: - resolution: {integrity: sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==} - dependencies: - d: 1.0.1 - ext: 1.7.0 - dev: false - - /es6-weak-map@2.0.3: - resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==} - dependencies: - d: 1.0.1 - es5-ext: 0.10.62 - es6-iterator: 2.0.3 - es6-symbol: 3.1.3 - dev: false - - /escalade@3.1.1: - resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} - engines: {node: '>=6'} - dev: true - - /escape-string-regexp@1.0.5: - resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} - engines: {node: '>=0.8.0'} - - /escape-string-regexp@4.0.0: - resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} - engines: {node: '>=10'} - dev: true - - /eslint-config-neon@0.1.47(eslint@8.40.0)(svelte@3.59.2)(typescript@5.0.4): - resolution: {integrity: sha512-Ya9Q3u8DZufNwMDE3hRJ5+6VkZ+/OmJjyH1BLUotSBBEixiFZsOaouzWJer3edVkUf3VLjoZLUXrTlWvGnb34A==} - engines: {node: '>=16.0.0'} - dependencies: - '@angular-eslint/eslint-plugin': 16.0.3(eslint@8.40.0)(typescript@5.0.4) - '@angular-eslint/eslint-plugin-template': 16.0.3(eslint@8.40.0)(typescript@5.0.4) - '@angular-eslint/template-parser': 16.0.3(eslint@8.40.0)(typescript@5.0.4) - '@next/eslint-plugin-next': 13.4.6 - '@rushstack/eslint-patch': 1.3.2 - '@typescript-eslint/eslint-plugin': 5.60.0(@typescript-eslint/parser@5.60.0)(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/parser': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - astro-eslint-parser: 0.13.3 - eslint-config-prettier: 8.8.0(eslint@8.40.0) - eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/parser@5.60.0)(eslint-plugin-i@2.27.5-4)(eslint@8.40.0) - eslint-plugin-astro: 0.26.2(eslint@8.40.0) - eslint-plugin-cypress: 2.13.3(eslint@8.40.0) - eslint-plugin-import: /eslint-plugin-i@2.27.5-4(@typescript-eslint/parser@5.60.0)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0) - eslint-plugin-jest: 27.2.2(@typescript-eslint/eslint-plugin@5.60.0)(eslint@8.40.0)(typescript@5.0.4) - eslint-plugin-jsdoc: 43.2.0(eslint@8.40.0) - eslint-plugin-jsx-a11y: 6.7.1(eslint@8.40.0) - eslint-plugin-lodash: 7.4.0(eslint@8.40.0) - eslint-plugin-mdx: 2.1.0(eslint@8.40.0) - eslint-plugin-n: 15.7.0(eslint@8.40.0) - eslint-plugin-promise: 6.1.1(eslint@8.40.0) - eslint-plugin-react: 7.32.2(eslint@8.40.0) - eslint-plugin-react-hooks: 4.6.0(eslint@8.40.0) - eslint-plugin-rxjs: 5.0.3(eslint@8.40.0)(typescript@5.0.4) - eslint-plugin-rxjs-angular: 2.0.1(eslint@8.40.0)(typescript@5.0.4) - eslint-plugin-sonarjs: 0.19.0(eslint@8.40.0) - eslint-plugin-svelte3: 4.0.0(eslint@8.40.0)(svelte@3.59.2) - eslint-plugin-tsdoc: 0.2.17 - eslint-plugin-typescript-sort-keys: 2.3.0(@typescript-eslint/parser@5.60.0)(eslint@8.40.0)(typescript@5.0.4) - eslint-plugin-unicorn: 47.0.0(eslint@8.40.0) - eslint-plugin-vue: 9.15.0(eslint@8.40.0) - vue-eslint-parser: 9.3.1(eslint@8.40.0) - transitivePeerDependencies: - - eslint - - eslint-import-resolver-node - - eslint-import-resolver-webpack - - jest - - supports-color - - svelte - - typescript - dev: true - - /eslint-config-prettier@8.8.0(eslint@8.40.0): - resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} - hasBin: true - peerDependencies: - eslint: '>=7.0.0' - dependencies: - eslint: 8.40.0 - dev: true - - /eslint-etc@5.2.1(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-lFJBSiIURdqQKq9xJhvSJFyPA+VeTh5xvk24e8pxVL7bwLBtGF60C/KRkLTMrvCZ6DA3kbPuYhLWY0TZMlqTsg==} - peerDependencies: - eslint: ^8.0.0 - typescript: '>=4.0.0' - dependencies: - '@typescript-eslint/experimental-utils': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - eslint: 8.40.0 - tsutils: 3.21.0(typescript@5.0.4) - tsutils-etc: 1.4.2(tsutils@3.21.0)(typescript@5.0.4) - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-import-resolver-node@0.3.7: - resolution: {integrity: sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==} - dependencies: - debug: 3.2.7(supports-color@5.5.0) - is-core-module: 2.12.1 - resolve: 1.22.2 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-import-resolver-typescript@3.5.5(@typescript-eslint/parser@5.60.0)(eslint-plugin-i@2.27.5-4)(eslint@8.40.0): - resolution: {integrity: sha512-TdJqPHs2lW5J9Zpe17DZNQuDnox4xo2o+0tE7Pggain9Rbc19ik8kFtXdxZ250FVx2kF4vlt2RSf4qlUpG7bhw==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - eslint: '*' - eslint-plugin-import: '*' - dependencies: - debug: 4.3.4(supports-color@5.5.0) - enhanced-resolve: 5.15.0 - eslint: 8.40.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.60.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0) - eslint-plugin-import: /eslint-plugin-i@2.27.5-4(@typescript-eslint/parser@5.60.0)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0) - get-tsconfig: 4.6.0 - globby: 13.2.0 - is-core-module: 2.12.1 - is-glob: 4.0.3 - synckit: 0.8.5 - transitivePeerDependencies: - - '@typescript-eslint/parser' - - eslint-import-resolver-node - - eslint-import-resolver-webpack - - supports-color - dev: true - - /eslint-mdx@2.1.0(eslint@8.40.0): - resolution: {integrity: sha512-dVLHDcpCFJRXZhxEQx8nKc68KT1qm+9JOeMD+j1/WW2h+oco1j7Qq+CLrX2kP64LI3fF9TUtj7a0AvncHUME6w==} - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - peerDependencies: - eslint: '>=8.0.0' - dependencies: - acorn: 8.9.0 - acorn-jsx: 5.3.2(acorn@8.9.0) - eslint: 8.40.0 - espree: 9.5.2 - estree-util-visit: 1.2.1 - remark-mdx: 2.3.0 - remark-parse: 10.0.2 - remark-stringify: 10.0.3 - synckit: 0.8.5 - tslib: 2.5.3 - unified: 10.1.2 - unified-engine: 10.1.0 - unist-util-visit: 4.1.2 - uvu: 0.5.6 - vfile: 5.3.7 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.60.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0): - resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint: - optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true - dependencies: - '@typescript-eslint/parser': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - debug: 3.2.7(supports-color@5.5.0) - eslint: 8.40.0 - eslint-import-resolver-node: 0.3.7 - eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/parser@5.60.0)(eslint-plugin-i@2.27.5-4)(eslint@8.40.0) - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-plugin-astro@0.26.2(eslint@8.40.0): - resolution: {integrity: sha512-unST3JZO+W8Beoxfyu6Gpgbx9KAZJ3QBBT7SLzeB5kUbuSrJ40uzYbdsE4wgkZWyiAHkvjAAvQzDP9vH6Dk2eg==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - eslint: '>=7.0.0' - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - '@jridgewell/sourcemap-codec': 1.4.15 - '@typescript-eslint/types': 5.60.0 - astro-eslint-parser: 0.13.3 - eslint: 8.40.0 - postcss: 8.4.24 - postcss-selector-parser: 6.0.13 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-plugin-cypress@2.13.3(eslint@8.40.0): - resolution: {integrity: sha512-nAPjZE5WopCsgJwl3vHm5iafpV+ZRO76Z9hMyRygWhmg5ODXDPd+9MaPl7kdJ2azj+sO87H3P1PRnggIrz848g==} - peerDependencies: - eslint: '>= 3.2.1' - dependencies: - eslint: 8.40.0 - globals: 11.12.0 - dev: true - - /eslint-plugin-es@4.1.0(eslint@8.40.0): - resolution: {integrity: sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==} - engines: {node: '>=8.10.0'} - peerDependencies: - eslint: '>=4.19.1' - dependencies: - eslint: 8.40.0 - eslint-utils: 2.1.0 - regexpp: 3.2.0 - dev: true - - /eslint-plugin-i@2.27.5-4(@typescript-eslint/parser@5.60.0)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0): - resolution: {integrity: sha512-X3Z+dp9nZw7d/y41EDO6JyFw4WVMOT91SFuoJvL0C0/4M1l6NxQ5mLTjXHuYhq0AazW75pAmj25yMk5wPMzjsw==} - engines: {node: '>=12'} - peerDependencies: - eslint: ^7.2.0 || ^8 - dependencies: - debug: 3.2.7(supports-color@5.5.0) - doctrine: 2.1.0 - eslint: 8.40.0 - eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.60.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.40.0) - get-tsconfig: 4.6.0 - is-glob: 4.0.3 - minimatch: 3.1.2 - resolve: 1.22.3 - semver: 7.5.3 - transitivePeerDependencies: - - '@typescript-eslint/parser' - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color - dev: true - - /eslint-plugin-jest@27.2.2(@typescript-eslint/eslint-plugin@5.60.0)(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-euzbp06F934Z7UDl5ZUaRPLAc9MKjh0rMPERrHT7UhlCEwgb25kBj37TvMgWeHZVkR5I9CayswrpoaqZU1RImw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@typescript-eslint/eslint-plugin': ^5.0.0 - eslint: ^7.0.0 || ^8.0.0 - jest: '*' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - jest: - optional: true - dependencies: - '@typescript-eslint/eslint-plugin': 5.60.0(@typescript-eslint/parser@5.60.0)(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/utils': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - eslint: 8.40.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /eslint-plugin-jsdoc@43.2.0(eslint@8.40.0): - resolution: {integrity: sha512-Hst7XUfqh28UmPD52oTXmjaRN3d0KrmOZdgtp4h9/VHUJD3Evoo82ZGXi1TtRDWgWhvqDIRI63O49H0eH7NrZQ==} - engines: {node: '>=16'} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - '@es-joy/jsdoccomment': 0.38.0 - are-docs-informative: 0.0.2 - comment-parser: 1.3.1 - debug: 4.3.4(supports-color@5.5.0) - escape-string-regexp: 4.0.0 - eslint: 8.40.0 - esquery: 1.5.0 - semver: 7.5.2 - spdx-expression-parse: 3.0.1 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-plugin-jsx-a11y@6.7.1(eslint@8.40.0): - resolution: {integrity: sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA==} - engines: {node: '>=4.0'} - peerDependencies: - eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 - dependencies: - '@babel/runtime': 7.22.5 - aria-query: 5.2.1 - array-includes: 3.1.6 - array.prototype.flatmap: 1.3.1 - ast-types-flow: 0.0.7 - axe-core: 4.7.2 - axobject-query: 3.2.1 - damerau-levenshtein: 1.0.8 - emoji-regex: 9.2.2 - eslint: 8.40.0 - has: 1.0.3 - jsx-ast-utils: 3.3.3 - language-tags: 1.0.5 - minimatch: 3.1.2 - object.entries: 1.1.6 - object.fromentries: 2.0.6 - semver: 6.3.0 - dev: true - - /eslint-plugin-lodash@7.4.0(eslint@8.40.0): - resolution: {integrity: sha512-Tl83UwVXqe1OVeBRKUeWcfg6/pCW1GTRObbdnbEJgYwjxp5Q92MEWQaH9+dmzbRt6kvYU1Mp893E79nJiCSM8A==} - engines: {node: '>=10'} - peerDependencies: - eslint: '>=2' - dependencies: - eslint: 8.40.0 - lodash: 4.17.21 - dev: true - - /eslint-plugin-markdown@3.0.0(eslint@8.40.0): - resolution: {integrity: sha512-hRs5RUJGbeHDLfS7ELanT0e29Ocyssf/7kBM+p7KluY5AwngGkDf8Oyu4658/NZSGTTq05FZeWbkxXtbVyHPwg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - eslint: 8.40.0 - mdast-util-from-markdown: 0.8.5 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-plugin-mdx@2.1.0(eslint@8.40.0): - resolution: {integrity: sha512-Q8P1JXv+OrD+xhWT95ZyV30MMdnqJ1voKtXfxWrJJ2XihJRI15gPmXbIWY9t8CjA8C//isfzNOmnVY9e3GTL0g==} - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - peerDependencies: - eslint: '>=8.0.0' - dependencies: - eslint: 8.40.0 - eslint-mdx: 2.1.0(eslint@8.40.0) - eslint-plugin-markdown: 3.0.0(eslint@8.40.0) - remark-mdx: 2.3.0 - remark-parse: 10.0.2 - remark-stringify: 10.0.3 - tslib: 2.5.3 - unified: 10.1.2 - vfile: 5.3.7 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-plugin-n@15.7.0(eslint@8.40.0): - resolution: {integrity: sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==} - engines: {node: '>=12.22.0'} - peerDependencies: - eslint: '>=7.0.0' - dependencies: - builtins: 5.0.1 - eslint: 8.40.0 - eslint-plugin-es: 4.1.0(eslint@8.40.0) - eslint-utils: 3.0.0(eslint@8.40.0) - ignore: 5.2.4 - is-core-module: 2.12.1 - minimatch: 3.1.2 - resolve: 1.22.2 - semver: 7.5.2 - dev: true - - /eslint-plugin-promise@6.1.1(eslint@8.40.0): - resolution: {integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - eslint: 8.40.0 - dev: true - - /eslint-plugin-react-hooks@4.6.0(eslint@8.40.0): - resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} - engines: {node: '>=10'} - peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 - dependencies: - eslint: 8.40.0 - dev: true - - /eslint-plugin-react@7.32.2(eslint@8.40.0): - resolution: {integrity: sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg==} - engines: {node: '>=4'} - peerDependencies: - eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 - dependencies: - array-includes: 3.1.6 - array.prototype.flatmap: 1.3.1 - array.prototype.tosorted: 1.1.1 - doctrine: 2.1.0 - eslint: 8.40.0 - estraverse: 5.3.0 - jsx-ast-utils: 3.3.3 - minimatch: 3.1.2 - object.entries: 1.1.6 - object.fromentries: 2.0.6 - object.hasown: 1.1.2 - object.values: 1.1.6 - prop-types: 15.8.1 - resolve: 2.0.0-next.4 - semver: 6.3.0 - string.prototype.matchall: 4.0.8 - dev: true - - /eslint-plugin-rxjs-angular@2.0.1(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-HJ/JHhjDJKyFUmM8o7rS91WNkNv7W7Z/okR5X3hqG7tKVMLOJi4T63Aa74ECuCdowmdfW75p2RrW4R8WeoZIKQ==} - peerDependencies: - eslint: ^8.0.0 - typescript: '>=4.0.0' - dependencies: - '@typescript-eslint/experimental-utils': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - common-tags: 1.8.2 - eslint: 8.40.0 - eslint-etc: 5.2.1(eslint@8.40.0)(typescript@5.0.4) - requireindex: 1.2.0 - tslib: 2.5.3 - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-plugin-rxjs@5.0.3(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-fcVkqLmYLRfRp+ShafjpUKuaZ+cw/sXAvM5dfSxiEr7M28QZ/NY7vaOr09FB4rSaZsQyLBnNPh5SL+4EgKjh8Q==} - peerDependencies: - eslint: ^8.0.0 - typescript: '>=4.0.0' - dependencies: - '@typescript-eslint/experimental-utils': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - common-tags: 1.8.2 - decamelize: 5.0.1 - eslint: 8.40.0 - eslint-etc: 5.2.1(eslint@8.40.0)(typescript@5.0.4) - requireindex: 1.2.0 - rxjs-report-usage: 1.0.6 - tslib: 2.5.3 - tsutils: 3.21.0(typescript@5.0.4) - tsutils-etc: 1.4.2(tsutils@3.21.0)(typescript@5.0.4) - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-plugin-sonarjs@0.19.0(eslint@8.40.0): - resolution: {integrity: sha512-6+s5oNk5TFtVlbRxqZN7FIGmjdPCYQKaTzFPmqieCmsU1kBYDzndTeQav0xtQNwZJWu5awWfTGe8Srq9xFOGnw==} - engines: {node: '>=14'} - peerDependencies: - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - eslint: 8.40.0 - dev: true - - /eslint-plugin-svelte3@4.0.0(eslint@8.40.0)(svelte@3.59.2): - resolution: {integrity: sha512-OIx9lgaNzD02+MDFNLw0GEUbuovNcglg+wnd/UY0fbZmlQSz7GlQiQ1f+yX0XvC07XPcDOnFcichqI3xCwp71g==} - peerDependencies: - eslint: '>=8.0.0' - svelte: ^3.2.0 - dependencies: - eslint: 8.40.0 - svelte: 3.59.2 - dev: true - - /eslint-plugin-tsdoc@0.2.17: - resolution: {integrity: sha512-xRmVi7Zx44lOBuYqG8vzTXuL6IdGOeF9nHX17bjJ8+VE6fsxpdGem0/SBTmAwgYMKYB1WBkqRJVQ+n8GK041pA==} - dependencies: - '@microsoft/tsdoc': 0.14.2 - '@microsoft/tsdoc-config': 0.16.2 - dev: true - - /eslint-plugin-typescript-sort-keys@2.3.0(@typescript-eslint/parser@5.60.0)(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-3LAcYulo5gNYiPWee+TksITfvWeBuBjGgcSLTacPESFVKEoy8laOQuZvJlSCwTBHT2SCGIxr3bJ56zuux+3MCQ==} - engines: {node: 12 || >= 13.9} - peerDependencies: - '@typescript-eslint/parser': ^1 || ^2 || ^3 || ^4 || ^5 - eslint: ^5 || ^6 || ^7 || ^8 - typescript: ^3 || ^4 || ^5 - dependencies: - '@typescript-eslint/experimental-utils': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/parser': 5.60.0(eslint@8.40.0)(typescript@5.0.4) - eslint: 8.40.0 - json-schema: 0.4.0 - natural-compare-lite: 1.4.0 - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-plugin-unicorn@47.0.0(eslint@8.40.0): - resolution: {integrity: sha512-ivB3bKk7fDIeWOUmmMm9o3Ax9zbMz1Bsza/R2qm46ufw4T6VBFBaJIR1uN3pCKSmSXm8/9Nri8V+iUut1NhQGA==} - engines: {node: '>=16'} - peerDependencies: - eslint: '>=8.38.0' - dependencies: - '@babel/helper-validator-identifier': 7.22.5 - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - ci-info: 3.8.0 - clean-regexp: 1.0.0 - eslint: 8.40.0 - esquery: 1.5.0 - indent-string: 4.0.0 - is-builtin-module: 3.2.1 - jsesc: 3.0.2 - lodash: 4.17.21 - pluralize: 8.0.0 - read-pkg-up: 7.0.1 - regexp-tree: 0.1.27 - regjsparser: 0.10.0 - safe-regex: 2.1.1 - semver: 7.5.2 - strip-indent: 3.0.0 - dev: true - - /eslint-plugin-vue@9.15.0(eslint@8.40.0): - resolution: {integrity: sha512-XYzpK6e2REli100+6iCeBA69v6Sm0D/yK2FZP+fCeNt0yH/m82qZQq+ztseyV0JsKdhFysuSEzeE1yCmSC92BA==} - engines: {node: ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - eslint: 8.40.0 - natural-compare: 1.4.0 - nth-check: 2.1.1 - postcss-selector-parser: 6.0.13 - semver: 7.5.2 - vue-eslint-parser: 9.3.1(eslint@8.40.0) - xml-name-validator: 4.0.0 - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 - dev: true - - /eslint-scope@7.2.0: - resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - dev: true - - /eslint-utils@2.1.0: - resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} - engines: {node: '>=6'} - dependencies: - eslint-visitor-keys: 1.3.0 - dev: true - - /eslint-utils@3.0.0(eslint@8.40.0): - resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} - engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} - peerDependencies: - eslint: '>=5' - dependencies: - eslint: 8.40.0 - eslint-visitor-keys: 2.1.0 - dev: true - - /eslint-visitor-keys@1.3.0: - resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} - engines: {node: '>=4'} - dev: true - - /eslint-visitor-keys@2.1.0: - resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} - engines: {node: '>=10'} - dev: true - - /eslint-visitor-keys@3.4.1: - resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /eslint@8.40.0: - resolution: {integrity: sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - hasBin: true - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - '@eslint-community/regexpp': 4.5.1 - '@eslint/eslintrc': 2.0.3 - '@eslint/js': 8.40.0 - '@humanwhocodes/config-array': 0.11.10 - '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@5.5.0) - doctrine: 3.0.0 - escape-string-regexp: 4.0.0 - eslint-scope: 7.2.0 - eslint-visitor-keys: 3.4.1 - espree: 9.5.2 - esquery: 1.5.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - find-up: 5.0.0 - glob-parent: 6.0.2 - globals: 13.20.0 - grapheme-splitter: 1.0.4 - ignore: 5.2.4 - import-fresh: 3.3.0 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-sdsl: 4.4.1 - js-yaml: 4.1.0 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.1 - strip-ansi: 6.0.1 - strip-json-comments: 3.1.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - dev: true - - /espree@9.5.2: - resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - acorn: 8.9.0 - acorn-jsx: 5.3.2(acorn@8.9.0) - eslint-visitor-keys: 3.4.1 - dev: true - - /esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - dev: true - - /esquery@1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} - engines: {node: '>=0.10'} - dependencies: - estraverse: 5.3.0 - dev: true - - /esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - dependencies: - estraverse: 5.3.0 - dev: true - - /estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - dev: true - - /estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - dev: true - - /estree-util-is-identifier-name@2.1.0: - resolution: {integrity: sha512-bEN9VHRyXAUOjkKVQVvArFym08BTWB0aJPppZZr0UNyAqWsLaVfAqP7hbaTJjzHifmB5ebnR8Wm7r7yGN/HonQ==} - dev: true - - /estree-util-visit@1.2.1: - resolution: {integrity: sha512-xbgqcrkIVbIG+lI/gzbvd9SGTJL4zqJKBFttUl5pP27KhAjtMKbX/mQXJ7qgyXpMgVy/zvpm0xoQQaGL8OloOw==} - dependencies: - '@types/estree-jsx': 1.0.0 - '@types/unist': 2.0.6 - dev: true - - /esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - dev: true - - /event-emitter@0.3.5: - resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==} - dependencies: - d: 1.0.1 - es5-ext: 0.10.62 - dev: false - - /execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 2.1.0 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 - - /execa@7.1.1: - resolution: {integrity: sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q==} - engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 4.3.1 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.1.0 - onetime: 6.0.0 - signal-exit: 3.0.7 - strip-final-newline: 3.0.0 - dev: true - - /execcli@5.0.6: - resolution: {integrity: sha512-du+uy/Ew2P90PKjSHI89u/XuqVaBDzvaJ6ePn40JaOy7owFQNsYDbd5AoR5A559HEAb1i5HO22rJxtgVonf5Bg==} - engines: {node: '>=8', npm: '>=4'} - dependencies: - argx: 4.0.4 - arrayreduce: 2.1.0 - findout: 3.0.2 - hasbin: 1.2.3 - stringcase: 4.3.1 - dev: false - - /ext@1.7.0: - resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} - dependencies: - type: 2.7.2 - dev: false - - /extend@3.0.2: - resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} - - /extendable-error@0.1.7: - resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} - dev: true - - /external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - /fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - dev: true - - /fast-glob@3.2.12: - resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} - engines: {node: '>=8.6.0'} - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - - /fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - dev: true - - /fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - dev: true - - /fastq@1.15.0: - resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} - dependencies: - reusify: 1.0.4 - - /fault@1.0.4: - resolution: {integrity: sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==} - dependencies: - format: 0.2.2 - dev: false - - /fault@2.0.1: - resolution: {integrity: sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==} - dependencies: - format: 0.2.2 - dev: true - - /figures@3.2.0: - resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} - engines: {node: '>=8'} - dependencies: - escape-string-regexp: 1.0.5 - dev: false - - /file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} - dependencies: - flat-cache: 3.0.4 - dev: true - - /fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - dependencies: - to-regex-range: 5.0.1 - - /find-up@3.0.0: - resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} - engines: {node: '>=6'} - dependencies: - locate-path: 3.0.0 - dev: false - - /find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} - dependencies: - locate-path: 5.0.0 - path-exists: 4.0.0 - dev: true - - /find-up@5.0.0: - resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} - engines: {node: '>=10'} - dependencies: - locate-path: 6.0.0 - path-exists: 4.0.0 - dev: true - - /find-yarn-workspace-root2@1.2.16: - resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} - dependencies: - micromatch: 4.0.5 - pkg-dir: 4.2.0 - dev: true - - /findout@3.0.2: - resolution: {integrity: sha512-eatRX+s8jm8ml/S9Y5NBBjR4W8i7IeEmyddB3Lidak/nPZNfDxGzLEIaMKgeNj5/LHA1i0dC4Gwsb13H1bx+AA==} - engines: {node: '>=7.6', npm: '>=4'} - dev: false - - /flat-cache@3.0.4: - resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} - engines: {node: ^10.12.0 || >=12.0.0} - dependencies: - flatted: 3.2.7 - rimraf: 3.0.2 - dev: true - - /flatted@3.2.7: - resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} - dev: true - - /for-each@0.3.3: - resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} - dependencies: - is-callable: 1.2.7 - dev: true - - /foreground-child@3.1.1: - resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} - engines: {node: '>=14'} - dependencies: - cross-spawn: 7.0.3 - signal-exit: 4.0.2 - dev: true - - /form-data@3.0.1: - resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: false - - /format@0.2.2: - resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} - engines: {node: '>=0.4.x'} - - /fraction.js@4.2.0: - resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==} - dev: true - - /fs-extra@11.1.1: - resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} - engines: {node: '>=14.14'} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.0 - dev: true - - /fs-extra@7.0.1: - resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} - engines: {node: '>=6 <7 || >=8'} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 4.0.0 - universalify: 0.1.2 - dev: true - - /fs-extra@8.1.0: - resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} - engines: {node: '>=6 <7 || >=8'} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 4.0.0 - universalify: 0.1.2 - dev: true - - /fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - dev: true - - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /function-bind@1.1.1: - resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - - /function.prototype.name@1.1.5: - resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - functions-have-names: 1.2.3 - dev: true - - /functions-have-names@1.2.3: - resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - dev: true - - /gen-esm-wrapper@1.1.3: - resolution: {integrity: sha512-LNHZ+QpaCW/0VhABIbXn45V+P8kFvjjwuue9hbV23eOjuFVz6c0FE3z1XpLX9pSjLW7UmtCkXo5F9vhZWVs8oQ==} - hasBin: true - dependencies: - is-valid-identifier: 2.0.2 - dev: true - - /get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - /get-intrinsic@1.2.1: - resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==} - dependencies: - function-bind: 1.1.1 - has: 1.0.3 - has-proto: 1.0.1 - has-symbols: 1.0.3 - - /get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} - - /get-symbol-description@1.0.0: - resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.1 - dev: true - - /get-tsconfig@4.6.0: - resolution: {integrity: sha512-lgbo68hHTQnFddybKbbs/RDRJnJT5YyGy2kQzVwbq+g67X73i+5MVTval34QxGkOe9X5Ujf1UYpCaphLyltjEg==} - dependencies: - resolve-pkg-maps: 1.0.0 - dev: true - - /gitconfig@2.0.8: - resolution: {integrity: sha512-qOB1QswIHFNKAOPN0pEu7U1iyajLBv3Tz5X630UlkAtKM904I4dO7XIjH84wmR2SUVAgaVR99UC9U4ABJujAJQ==} - engines: {node: '>=6', npm: '>=3'} - dependencies: - argx: 3.0.2 - arrayreduce: 2.1.0 - askconfig: 4.0.4 - co: 4.6.0 - execcli: 5.0.6 - lodash.get: 4.4.2 - objnest: 5.1.1 - dev: false - - /glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - dependencies: - is-glob: 4.0.3 - - /glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} - dependencies: - is-glob: 4.0.3 - dev: true - - /glob@10.2.7: - resolution: {integrity: sha512-jTKehsravOJo8IJxUGfZILnkvVJM/MOfHRs8QcXolVef2zNI9Tqyy5+SeuOAZd3upViEZQLyFpQhYiHLrMUNmA==} - engines: {node: '>=16 || 14 >=14.17'} - hasBin: true - dependencies: - foreground-child: 3.1.1 - jackspeak: 2.2.1 - minimatch: 9.0.1 - minipass: 6.0.2 - path-scurry: 1.9.2 - dev: true - - /glob@7.1.6: - resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true - - /glob@7.1.7: - resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true - - /glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true - - /glob@8.1.0: - resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} - engines: {node: '>=12'} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 5.1.6 - once: 1.4.0 - dev: true - - /globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - - /globals@13.20.0: - resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.20.2 - dev: true - - /globalthis@1.0.3: - resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} - engines: {node: '>= 0.4'} - dependencies: - define-properties: 1.2.0 - dev: true - - /globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} - dependencies: - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.2.12 - ignore: 5.2.4 - merge2: 1.4.1 - slash: 3.0.0 - - /globby@13.2.0: - resolution: {integrity: sha512-jWsQfayf13NvqKUIL3Ta+CIqMnvlaIDFveWE/dpOZ9+3AMEJozsxDvKA02zync9UuvOM8rOXzsD5GqKP4OnWPQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - dir-glob: 3.0.1 - fast-glob: 3.2.12 - ignore: 5.2.4 - merge2: 1.4.1 - slash: 4.0.0 - dev: true - - /good-listener@1.2.2: - resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==} - dependencies: - delegate: 3.2.0 - dev: false - optional: true - - /gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - dependencies: - get-intrinsic: 1.2.1 - dev: true - - /graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - dev: true - - /grapheme-splitter@1.0.4: - resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} - dev: true - - /handlebars@4.7.7: - resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==} - engines: {node: '>=0.4.7'} - hasBin: true - dependencies: - minimist: 1.2.8 - neo-async: 2.6.2 - source-map: 0.6.1 - wordwrap: 1.0.0 - optionalDependencies: - uglify-js: 3.17.4 - - /hard-rejection@2.1.0: - resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} - engines: {node: '>=6'} - dev: true - - /has-bigints@1.0.2: - resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} - dev: true - - /has-flag@3.0.0: - resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} - engines: {node: '>=4'} - - /has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - /has-property-descriptors@1.0.0: - resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} - dependencies: - get-intrinsic: 1.2.1 - dev: true - - /has-proto@1.0.1: - resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} - engines: {node: '>= 0.4'} - - /has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - /has-tostringtag@1.0.0: - resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} - engines: {node: '>= 0.4'} - dependencies: - has-symbols: 1.0.3 - dev: true - - /has@1.0.3: - resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} - engines: {node: '>= 0.4.0'} - dependencies: - function-bind: 1.1.1 - - /hasbin@1.2.3: - resolution: {integrity: sha512-CCd8e/w2w28G8DyZvKgiHnQJ/5XXDz6qiUHnthvtag/6T5acUeN5lqq+HMoBqcmgWueWDhiCplrw0Kb1zDACRg==} - engines: {node: '>=0.10'} - dependencies: - async: 1.5.2 - dev: false - - /hast-util-parse-selector@2.2.5: - resolution: {integrity: sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ==} - dev: false - - /hastscript@5.1.2: - resolution: {integrity: sha512-WlztFuK+Lrvi3EggsqOkQ52rKbxkXL3RwB6t5lwoa8QLMemoWfBuL43eDrwOamJyR7uKQKdmKYaBH1NZBiIRrQ==} - dependencies: - comma-separated-tokens: 1.0.8 - hast-util-parse-selector: 2.2.5 - property-information: 5.6.0 - space-separated-tokens: 1.1.5 - dev: false - - /highlight.js@9.15.10: - resolution: {integrity: sha512-RoV7OkQm0T3os3Dd2VHLNMoaoDVx77Wygln3n9l5YV172XonWG6rgQD3XnF/BuFFZw9A0TJgmMSO8FEWQgvcXw==} - deprecated: Version no longer supported. Upgrade to @latest - dev: false - - /hoist-non-react-statics@3.3.2: - resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} - dependencies: - react-is: 16.13.1 - dev: false - - /hosted-git-info@2.8.9: - resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} - dev: true - - /human-id@1.0.2: - resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} - dev: true - - /human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} - - /human-signals@4.3.1: - resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} - engines: {node: '>=14.18.0'} - dev: true - - /husky@7.0.4: - resolution: {integrity: sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==} - engines: {node: '>=12'} - hasBin: true - dev: true - - /iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - dependencies: - safer-buffer: 2.1.2 - - /iftype@3.0.2: - resolution: {integrity: sha512-vA/NSyCG3E7XXWC1hmbEDj8WvsduSzLblmj4m2Idywx8YC6CKqGTYzrnoxbMrC+qBcHz85P7uwBwYEY2rX1jvQ==} - engines: {node: '>=4', npm: '>=2'} - dependencies: - babel-runtime: 6.26.0 - dev: false - - /iftype@4.0.9: - resolution: {integrity: sha512-01Klo+04dkDzY193D1GVfOdQzmpqaYFJTAlZKRztkT/BOaU7sSnvxGimSln+7DMqLUP4tpDTNFgxqVPLYZVypA==} - engines: {node: '>=8', npm: '>=5'} - dev: false - - /ignore-by-default@1.0.1: - resolution: {integrity: sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==} - dev: true - - /ignore@5.2.4: - resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} - engines: {node: '>= 4'} - - /import-fresh@3.3.0: - resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} - engines: {node: '>=6'} - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - dev: true - - /import-meta-resolve@2.2.2: - resolution: {integrity: sha512-f8KcQ1D80V7RnqVm+/lirO9zkOxjGxhaTC1IPrBGd3MEfNgmNG67tSUO9gTi2F3Blr2Az6g1vocaxzkVnWl9MA==} - dev: true - - /imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - dev: true - - /indent-string@4.0.0: - resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} - engines: {node: '>=8'} - dev: true - - /inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - dev: true - - /inherits@2.0.1: - resolution: {integrity: sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==} - dev: true - - /inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: true - - /ini@4.1.1: - resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: true - - /inquirer@7.3.3: - resolution: {integrity: sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==} - engines: {node: '>=8.0.0'} - dependencies: - ansi-escapes: 4.3.2 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-width: 3.0.0 - external-editor: 3.1.0 - figures: 3.2.0 - lodash: 4.17.21 - mute-stream: 0.0.8 - run-async: 2.4.1 - rxjs: 6.6.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - through: 2.3.8 - dev: false - - /internal-slot@1.0.5: - resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.1 - has: 1.0.3 - side-channel: 1.0.4 - dev: true - - /is-alphabetical@1.0.4: - resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} - - /is-alphabetical@2.0.1: - resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} - dev: true - - /is-alphanumerical@1.0.4: - resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} - dependencies: - is-alphabetical: 1.0.4 - is-decimal: 1.0.4 - - /is-alphanumerical@2.0.1: - resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==} - dependencies: - is-alphabetical: 2.0.1 - is-decimal: 2.0.1 - dev: true - - /is-arguments@1.1.1: - resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: true - - /is-array-buffer@3.0.2: - resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.1 - is-typed-array: 1.1.10 - dev: true - - /is-arrayish@0.2.1: - resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - dev: true - - /is-bigint@1.0.4: - resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} - dependencies: - has-bigints: 1.0.2 - dev: true - - /is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - dependencies: - binary-extensions: 2.2.0 - dev: true - - /is-boolean-object@1.1.2: - resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: true - - /is-buffer@2.0.5: - resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} - engines: {node: '>=4'} - dev: true - - /is-builtin-module@3.2.1: - resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} - engines: {node: '>=6'} - dependencies: - builtin-modules: 3.3.0 - dev: true - - /is-callable@1.2.7: - resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} - engines: {node: '>= 0.4'} - dev: true - - /is-ci@3.0.1: - resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} - hasBin: true - dependencies: - ci-info: 3.8.0 - dev: true - - /is-core-module@2.12.1: - resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==} - dependencies: - has: 1.0.3 - dev: true - - /is-date-object@1.0.5: - resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: true - - /is-decimal@1.0.4: - resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} - - /is-decimal@2.0.1: - resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} - dev: true - - /is-docker@2.2.1: - resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} - engines: {node: '>=8'} - hasBin: true - dev: true - - /is-docker@3.0.0: - resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - hasBin: true - dev: true - - /is-empty@1.2.0: - resolution: {integrity: sha512-F2FnH/otLNJv0J6wc73A5Xo7oHLNnqplYqZhUu01tD54DIPvxIRSTSLkrUB/M0nHO4vo1O9PDfN4KoTxCzLh/w==} - dev: true - - /is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - /is-fullwidth-code-point@2.0.0: - resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} - engines: {node: '>=4'} - dev: false - - /is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - /is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - dev: true - - /is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - dependencies: - is-extglob: 2.1.1 - - /is-hexadecimal@1.0.4: - resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} - - /is-hexadecimal@2.0.1: - resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} - dev: true - - /is-inside-container@1.0.0: - resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} - engines: {node: '>=14.16'} - hasBin: true - dependencies: - is-docker: 3.0.0 - dev: true - - /is-map@2.0.2: - resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} - dev: true - - /is-negative-zero@2.0.2: - resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} - engines: {node: '>= 0.4'} - dev: true - - /is-number-object@1.0.7: - resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: true - - /is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - /is-path-inside@3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - dev: true - - /is-plain-obj@1.1.0: - resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} - engines: {node: '>=0.10.0'} - dev: true - - /is-plain-obj@4.1.0: - resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} - engines: {node: '>=12'} - dev: true - - /is-promise@2.2.2: - resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==} - dev: false - - /is-regex@1.1.4: - resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: true - - /is-set@2.0.2: - resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==} - dev: true - - /is-shared-array-buffer@1.0.2: - resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} - dependencies: - call-bind: 1.0.2 - dev: true - - /is-stream@2.0.1: - resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} - engines: {node: '>=8'} - - /is-stream@3.0.0: - resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: true - - /is-string@1.0.7: - resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: true - - /is-subdir@1.2.0: - resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} - engines: {node: '>=4'} - dependencies: - better-path-resolve: 1.0.0 - dev: true - - /is-symbol@1.0.4: - resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} - engines: {node: '>= 0.4'} - dependencies: - has-symbols: 1.0.3 - dev: true - - /is-typed-array@1.1.10: - resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - dev: true - - /is-utf8@0.2.1: - resolution: {integrity: sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==} - dev: false - - /is-valid-identifier@2.0.2: - resolution: {integrity: sha512-mpS5EGqXOwzXtKAg6I44jIAqeBfntFLxpAth1rrKbxtKyI6LPktyDYpHBI+tHlduhhX/SF26mFXmxQu995QVqg==} - dependencies: - assert: 1.5.0 - dev: true - - /is-weakmap@2.0.1: - resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==} - dev: true - - /is-weakref@1.0.2: - resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} - dependencies: - call-bind: 1.0.2 - dev: true - - /is-weakset@2.0.2: - resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.1 - dev: true - - /is-windows@1.0.2: - resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} - engines: {node: '>=0.10.0'} - dev: true - - /is-wsl@2.2.0: - resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} - engines: {node: '>=8'} - dependencies: - is-docker: 2.2.1 - dev: true - - /isarray@2.0.5: - resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - dev: true - - /isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - - /jackspeak@2.2.1: - resolution: {integrity: sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==} - engines: {node: '>=14'} - dependencies: - '@isaacs/cliui': 8.0.2 - optionalDependencies: - '@pkgjs/parseargs': 0.11.0 - dev: true - - /jiti@1.18.2: - resolution: {integrity: sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==} - hasBin: true - dev: true - - /jju@1.4.0: - resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} - dev: true - - /js-sdsl@4.4.1: - resolution: {integrity: sha512-6Gsx8R0RucyePbWqPssR8DyfuXmLBooYN5cZFZKjHGnQuaf7pEzhtpceagJxVu4LqhYY5EYA7nko3FmeHZ1KbA==} - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - /js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - dev: true - - /js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - dependencies: - argparse: 2.0.1 - dev: true - - /jsdoc-type-pratt-parser@4.0.0: - resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} - engines: {node: '>=12.0.0'} - dev: true - - /jsesc@0.5.0: - resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} - hasBin: true - dev: true - - /jsesc@2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} - hasBin: true - - /jsesc@3.0.2: - resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} - engines: {node: '>=6'} - hasBin: true - dev: true - - /json-parse-even-better-errors@2.3.1: - resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - dev: true - - /json-parse-even-better-errors@3.0.0: - resolution: {integrity: sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: true - - /json-schema-ref-parser@9.0.9: - resolution: {integrity: sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==} - engines: {node: '>=10'} - deprecated: Please switch to @apidevtools/json-schema-ref-parser - dependencies: - '@apidevtools/json-schema-ref-parser': 9.0.9 - dev: true - - /json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - dev: true - - /json-schema@0.4.0: - resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} - dev: true - - /json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - dev: true - - /jsonc-parser@3.2.0: - resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} - dev: true - - /jsonfile@4.0.0: - resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} - optionalDependencies: - graceful-fs: 4.2.11 - dev: true - - /jsonfile@6.1.0: - resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} - dependencies: - universalify: 2.0.0 - optionalDependencies: - graceful-fs: 4.2.11 - dev: true - - /jsx-ast-utils@3.3.3: - resolution: {integrity: sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==} - engines: {node: '>=4.0'} - dependencies: - array-includes: 3.1.6 - object.assign: 4.1.4 - dev: true - - /kind-of@6.0.3: - resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} - engines: {node: '>=0.10.0'} - dev: true - - /kleur@3.0.3: - resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} - engines: {node: '>=6'} - dev: true - - /kleur@4.1.5: - resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} - engines: {node: '>=6'} - dev: true - - /language-subtag-registry@0.3.22: - resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==} - dev: true - - /language-tags@1.0.5: - resolution: {integrity: sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==} - dependencies: - language-subtag-registry: 0.3.22 - dev: true - - /levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} - dependencies: - prelude-ls: 1.2.1 - type-check: 0.4.0 - dev: true - - /license.js@3.1.2: - resolution: {integrity: sha512-anbqciJ9HfQVMRicsegiZOJ6nrP93ly24alImDOO7KndNLs3Um861fSEpXpWqGPMOv7PfZTJZL1p4cPq+Au4BQ==} - engines: {node: '>=8.0.0'} - dependencies: - pify: 3.0.0 - dev: false - - /lilconfig@2.1.0: - resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} - engines: {node: '>=10'} - dev: true - - /lines-and-columns@1.2.4: - resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - dev: true - - /lines-and-columns@2.0.3: - resolution: {integrity: sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: true - - /lint-staged@13.2.2: - resolution: {integrity: sha512-71gSwXKy649VrSU09s10uAT0rWCcY3aewhMaHyl2N84oBk4Xs9HgxvUp3AYu+bNsK4NrOYYxvSgg7FyGJ+jGcA==} - engines: {node: ^14.13.1 || >=16.0.0} - hasBin: true - dependencies: - chalk: 5.2.0 - cli-truncate: 3.1.0 - commander: 10.0.1 - debug: 4.3.4(supports-color@5.5.0) - execa: 7.1.1 - lilconfig: 2.1.0 - listr2: 5.0.8 - micromatch: 4.0.5 - normalize-path: 3.0.0 - object-inspect: 1.12.3 - pidtree: 0.6.0 - string-argv: 0.3.2 - yaml: 2.3.1 - transitivePeerDependencies: - - enquirer - - supports-color - dev: true - - /listr2@5.0.8: - resolution: {integrity: sha512-mC73LitKHj9w6v30nLNGPetZIlfpUniNSsxxrbaPcWOjDb92SHPzJPi/t+v1YC/lxKz/AJ9egOjww0qUuFxBpA==} - engines: {node: ^14.13.1 || >=16.0.0} - peerDependencies: - enquirer: '>= 2.3.0 < 3' - peerDependenciesMeta: - enquirer: - optional: true - dependencies: - cli-truncate: 2.1.0 - colorette: 2.0.20 - log-update: 4.0.0 - p-map: 4.0.0 - rfdc: 1.3.0 - rxjs: 7.8.1 - through: 2.3.8 - wrap-ansi: 7.0.0 - dev: true - - /load-plugin@5.1.0: - resolution: {integrity: sha512-Lg1CZa1CFj2CbNaxijTL6PCbzd4qGTlZov+iH2p5Xwy/ApcZJh+i6jMN2cYePouTfjJfrNu3nXFdEw8LvbjPFQ==} - dependencies: - '@npmcli/config': 6.2.0 - import-meta-resolve: 2.2.2 - dev: true - - /load-yaml-file@0.2.0: - resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} - engines: {node: '>=6'} - dependencies: - graceful-fs: 4.2.11 - js-yaml: 3.14.1 - pify: 4.0.1 - strip-bom: 3.0.0 - dev: true - - /locate-path@3.0.0: - resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} - engines: {node: '>=6'} - dependencies: - p-locate: 3.0.0 - path-exists: 3.0.0 - dev: false - - /locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} - dependencies: - p-locate: 4.1.0 - dev: true - - /locate-path@6.0.0: - resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} - engines: {node: '>=10'} - dependencies: - p-locate: 5.0.0 - dev: true - - /lodash.get@4.4.2: - resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} - dev: false - - /lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - dev: true - - /lodash.startcase@4.4.0: - resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} - dev: true - - /lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - /log-update@4.0.0: - resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==} - engines: {node: '>=10'} - dependencies: - ansi-escapes: 4.3.2 - cli-cursor: 3.1.0 - slice-ansi: 4.0.0 - wrap-ansi: 6.2.0 - dev: true - - /longest-streak@3.1.0: - resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - - /lowlight@1.12.1: - resolution: {integrity: sha512-OqaVxMGIESnawn+TU/QMV5BJLbUghUfjDWPAtFqDYDmDtr4FnB+op8xM+pR7nKlauHNUHXGt0VgWatFB8voS5w==} - dependencies: - fault: 1.0.4 - highlight.js: 9.15.10 - dev: false - - /lru-cache@4.1.5: - resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} - dependencies: - pseudomap: 1.0.2 - yallist: 2.1.2 - dev: true - - /lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - dependencies: - yallist: 4.0.0 - dev: true - - /lru-cache@9.1.2: - resolution: {integrity: sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ==} - engines: {node: 14 || >=16.14} - dev: true - - /lru-queue@0.1.0: - resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==} - dependencies: - es5-ext: 0.10.62 - dev: false - - /lunr@2.3.9: - resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} - dev: true - - /make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - dev: true - - /map-obj@1.0.1: - resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} - engines: {node: '>=0.10.0'} - dev: true - - /map-obj@4.3.0: - resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} - engines: {node: '>=8'} - dev: true - - /marked@4.3.0: - resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} - engines: {node: '>= 12'} - hasBin: true - dev: true - - /mdast-util-from-markdown@0.8.5: - resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} - dependencies: - '@types/mdast': 3.0.11 - mdast-util-to-string: 2.0.0 - micromark: 2.11.4 - parse-entities: 2.0.0 - unist-util-stringify-position: 2.0.3 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-from-markdown@1.3.1: - resolution: {integrity: sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==} - dependencies: - '@types/mdast': 3.0.11 - '@types/unist': 2.0.6 - decode-named-character-reference: 1.0.2 - mdast-util-to-string: 3.2.0 - micromark: 3.2.0 - micromark-util-decode-numeric-character-reference: 1.1.0 - micromark-util-decode-string: 1.1.0 - micromark-util-normalize-identifier: 1.1.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - unist-util-stringify-position: 3.0.3 - uvu: 0.5.6 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-mdx-expression@1.3.2: - resolution: {integrity: sha512-xIPmR5ReJDu/DHH1OoIT1HkuybIfRGYRywC+gJtI7qHjCJp/M9jrmBEJW22O8lskDWm562BX2W8TiAwRTb0rKA==} - dependencies: - '@types/estree-jsx': 1.0.0 - '@types/hast': 2.3.4 - '@types/mdast': 3.0.11 - mdast-util-from-markdown: 1.3.1 - mdast-util-to-markdown: 1.5.0 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-mdx-jsx@2.1.4: - resolution: {integrity: sha512-DtMn9CmVhVzZx3f+optVDF8yFgQVt7FghCRNdlIaS3X5Bnym3hZwPbg/XW86vdpKjlc1PVj26SpnLGeJBXD3JA==} - dependencies: - '@types/estree-jsx': 1.0.0 - '@types/hast': 2.3.4 - '@types/mdast': 3.0.11 - '@types/unist': 2.0.6 - ccount: 2.0.1 - mdast-util-from-markdown: 1.3.1 - mdast-util-to-markdown: 1.5.0 - parse-entities: 4.0.1 - stringify-entities: 4.0.3 - unist-util-remove-position: 4.0.2 - unist-util-stringify-position: 3.0.3 - vfile-message: 3.1.4 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-mdx@2.0.1: - resolution: {integrity: sha512-38w5y+r8nyKlGvNjSEqWrhG0w5PmnRA+wnBvm+ulYCct7nsGYhFVb0lljS9bQav4psDAS1eGkP2LMVcZBi/aqw==} - dependencies: - mdast-util-from-markdown: 1.3.1 - mdast-util-mdx-expression: 1.3.2 - mdast-util-mdx-jsx: 2.1.4 - mdast-util-mdxjs-esm: 1.3.1 - mdast-util-to-markdown: 1.5.0 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-mdxjs-esm@1.3.1: - resolution: {integrity: sha512-SXqglS0HrEvSdUEfoXFtcg7DRl7S2cwOXc7jkuusG472Mmjag34DUDeOJUZtl+BVnyeO1frIgVpHlNRWc2gk/w==} - dependencies: - '@types/estree-jsx': 1.0.0 - '@types/hast': 2.3.4 - '@types/mdast': 3.0.11 - mdast-util-from-markdown: 1.3.1 - mdast-util-to-markdown: 1.5.0 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-phrasing@3.0.1: - resolution: {integrity: sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==} - dependencies: - '@types/mdast': 3.0.11 - unist-util-is: 5.2.1 - dev: true - - /mdast-util-to-markdown@1.5.0: - resolution: {integrity: sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==} - dependencies: - '@types/mdast': 3.0.11 - '@types/unist': 2.0.6 - longest-streak: 3.1.0 - mdast-util-phrasing: 3.0.1 - mdast-util-to-string: 3.2.0 - micromark-util-decode-string: 1.1.0 - unist-util-visit: 4.1.2 - zwitch: 2.0.4 - dev: true - - /mdast-util-to-string@2.0.0: - resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} - dev: true - - /mdast-util-to-string@3.2.0: - resolution: {integrity: sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==} - dependencies: - '@types/mdast': 3.0.11 - dev: true - - /memoizee@0.4.15: - resolution: {integrity: sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==} - dependencies: - d: 1.0.1 - es5-ext: 0.10.62 - es6-weak-map: 2.0.3 - event-emitter: 0.3.5 - is-promise: 2.2.2 - lru-queue: 0.1.0 - next-tick: 1.1.0 - timers-ext: 0.1.7 - dev: false - - /meow@6.1.1: - resolution: {integrity: sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==} - engines: {node: '>=8'} - dependencies: - '@types/minimist': 1.2.2 - camelcase-keys: 6.2.2 - decamelize-keys: 1.1.1 - hard-rejection: 2.1.0 - minimist-options: 4.1.0 - normalize-package-data: 2.5.0 - read-pkg-up: 7.0.1 - redent: 3.0.0 - trim-newlines: 3.0.1 - type-fest: 0.13.1 - yargs-parser: 18.1.3 - dev: true - - /merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - - /merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - /micromark-core-commonmark@1.1.0: - resolution: {integrity: sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==} - dependencies: - decode-named-character-reference: 1.0.2 - micromark-factory-destination: 1.1.0 - micromark-factory-label: 1.1.0 - micromark-factory-space: 1.1.0 - micromark-factory-title: 1.1.0 - micromark-factory-whitespace: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-chunked: 1.1.0 - micromark-util-classify-character: 1.1.0 - micromark-util-html-tag-name: 1.2.0 - micromark-util-normalize-identifier: 1.1.0 - micromark-util-resolve-all: 1.1.0 - micromark-util-subtokenize: 1.1.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - dev: true - - /micromark-extension-mdx-expression@1.0.8: - resolution: {integrity: sha512-zZpeQtc5wfWKdzDsHRBY003H2Smg+PUi2REhqgIhdzAa5xonhP03FcXxqFSerFiNUr5AWmHpaNPQTBVOS4lrXw==} - dependencies: - '@types/estree': 1.0.1 - micromark-factory-mdx-expression: 1.0.9 - micromark-factory-space: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-events-to-acorn: 1.2.3 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - dev: true - - /micromark-extension-mdx-jsx@1.0.5: - resolution: {integrity: sha512-gPH+9ZdmDflbu19Xkb8+gheqEDqkSpdCEubQyxuz/Hn8DOXiXvrXeikOoBA71+e8Pfi0/UYmU3wW3H58kr7akA==} - dependencies: - '@types/acorn': 4.0.6 - '@types/estree': 1.0.1 - estree-util-is-identifier-name: 2.1.0 - micromark-factory-mdx-expression: 1.0.9 - micromark-factory-space: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - vfile-message: 3.1.4 - dev: true - - /micromark-extension-mdx-md@1.0.1: - resolution: {integrity: sha512-7MSuj2S7xjOQXAjjkbjBsHkMtb+mDGVW6uI2dBL9snOBCbZmoNgDAeZ0nSn9j3T42UE/g2xVNMn18PJxZvkBEA==} - dependencies: - micromark-util-types: 1.1.0 - dev: true - - /micromark-extension-mdxjs-esm@1.0.5: - resolution: {integrity: sha512-xNRBw4aoURcyz/S69B19WnZAkWJMxHMT5hE36GtDAyhoyn/8TuAeqjFJQlwk+MKQsUD7b3l7kFX+vlfVWgcX1w==} - dependencies: - '@types/estree': 1.0.1 - micromark-core-commonmark: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-events-to-acorn: 1.2.3 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - unist-util-position-from-estree: 1.1.2 - uvu: 0.5.6 - vfile-message: 3.1.4 - dev: true - - /micromark-extension-mdxjs@1.0.1: - resolution: {integrity: sha512-7YA7hF6i5eKOfFUzZ+0z6avRG52GpWR8DL+kN47y3f2KhxbBZMhmxe7auOeaTBrW2DenbbZTf1ea9tA2hDpC2Q==} - dependencies: - acorn: 8.9.0 - acorn-jsx: 5.3.2(acorn@8.9.0) - micromark-extension-mdx-expression: 1.0.8 - micromark-extension-mdx-jsx: 1.0.5 - micromark-extension-mdx-md: 1.0.1 - micromark-extension-mdxjs-esm: 1.0.5 - micromark-util-combine-extensions: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-factory-destination@1.1.0: - resolution: {integrity: sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==} - dependencies: - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-factory-label@1.1.0: - resolution: {integrity: sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==} - dependencies: - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - dev: true - - /micromark-factory-mdx-expression@1.0.9: - resolution: {integrity: sha512-jGIWzSmNfdnkJq05c7b0+Wv0Kfz3NJ3N4cBjnbO4zjXIlxJr+f8lk+5ZmwFvqdAbUy2q6B5rCY//g0QAAaXDWA==} - dependencies: - '@types/estree': 1.0.1 - micromark-util-character: 1.2.0 - micromark-util-events-to-acorn: 1.2.3 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - unist-util-position-from-estree: 1.1.2 - uvu: 0.5.6 - vfile-message: 3.1.4 - dev: true - - /micromark-factory-space@1.1.0: - resolution: {integrity: sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==} - dependencies: - micromark-util-character: 1.2.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-factory-title@1.1.0: - resolution: {integrity: sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==} - dependencies: - micromark-factory-space: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-factory-whitespace@1.1.0: - resolution: {integrity: sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==} - dependencies: - micromark-factory-space: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-util-character@1.2.0: - resolution: {integrity: sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==} - dependencies: - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-util-chunked@1.1.0: - resolution: {integrity: sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==} - dependencies: - micromark-util-symbol: 1.1.0 - dev: true - - /micromark-util-classify-character@1.1.0: - resolution: {integrity: sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==} - dependencies: - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-util-combine-extensions@1.1.0: - resolution: {integrity: sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==} - dependencies: - micromark-util-chunked: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-util-decode-numeric-character-reference@1.1.0: - resolution: {integrity: sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==} - dependencies: - micromark-util-symbol: 1.1.0 - dev: true - - /micromark-util-decode-string@1.1.0: - resolution: {integrity: sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==} - dependencies: - decode-named-character-reference: 1.0.2 - micromark-util-character: 1.2.0 - micromark-util-decode-numeric-character-reference: 1.1.0 - micromark-util-symbol: 1.1.0 - dev: true - - /micromark-util-encode@1.1.0: - resolution: {integrity: sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==} - dev: true - - /micromark-util-events-to-acorn@1.2.3: - resolution: {integrity: sha512-ij4X7Wuc4fED6UoLWkmo0xJQhsktfNh1J0m8g4PbIMPlx+ek/4YdW5mvbye8z/aZvAPUoxgXHrwVlXAPKMRp1w==} - dependencies: - '@types/acorn': 4.0.6 - '@types/estree': 1.0.1 - '@types/unist': 2.0.6 - estree-util-visit: 1.2.1 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - vfile-message: 3.1.4 - dev: true - - /micromark-util-html-tag-name@1.2.0: - resolution: {integrity: sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==} - dev: true - - /micromark-util-normalize-identifier@1.1.0: - resolution: {integrity: sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==} - dependencies: - micromark-util-symbol: 1.1.0 - dev: true - - /micromark-util-resolve-all@1.1.0: - resolution: {integrity: sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==} - dependencies: - micromark-util-types: 1.1.0 - dev: true - - /micromark-util-sanitize-uri@1.2.0: - resolution: {integrity: sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==} - dependencies: - micromark-util-character: 1.2.0 - micromark-util-encode: 1.1.0 - micromark-util-symbol: 1.1.0 - dev: true - - /micromark-util-subtokenize@1.1.0: - resolution: {integrity: sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==} - dependencies: - micromark-util-chunked: 1.1.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - dev: true - - /micromark-util-symbol@1.1.0: - resolution: {integrity: sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==} - dev: true - - /micromark-util-types@1.1.0: - resolution: {integrity: sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==} - dev: true - - /micromark@2.11.4: - resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} - dependencies: - debug: 4.3.4(supports-color@5.5.0) - parse-entities: 2.0.0 - transitivePeerDependencies: - - supports-color - dev: true - - /micromark@3.2.0: - resolution: {integrity: sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==} - dependencies: - '@types/debug': 4.1.8 - debug: 4.3.4(supports-color@5.5.0) - decode-named-character-reference: 1.0.2 - micromark-core-commonmark: 1.1.0 - micromark-factory-space: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-chunked: 1.1.0 - micromark-util-combine-extensions: 1.1.0 - micromark-util-decode-numeric-character-reference: 1.1.0 - micromark-util-encode: 1.1.0 - micromark-util-normalize-identifier: 1.1.0 - micromark-util-resolve-all: 1.1.0 - micromark-util-sanitize-uri: 1.2.0 - micromark-util-subtokenize: 1.1.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - transitivePeerDependencies: - - supports-color - dev: true - - /micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - - /mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - /mimic-fn@4.0.0: - resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} - engines: {node: '>=12'} - dev: true - - /min-indent@1.0.1: - resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} - engines: {node: '>=4'} - dev: true - - /minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - dependencies: - brace-expansion: 1.1.11 - dev: true - - /minimatch@5.1.6: - resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} - engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - dev: true - - /minimatch@9.0.1: - resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} - engines: {node: '>=16 || 14 >=14.17'} - dependencies: - brace-expansion: 2.0.1 - dev: true - - /minimist-options@4.1.0: - resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} - engines: {node: '>= 6'} - dependencies: - arrify: 1.0.1 - is-plain-obj: 1.1.0 - kind-of: 6.0.3 - dev: true - - /minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - - /minipass@6.0.2: - resolution: {integrity: sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==} - engines: {node: '>=16 || 14 >=14.17'} - dev: true - - /mixme@0.5.9: - resolution: {integrity: sha512-VC5fg6ySUscaWUpI4gxCBTQMH2RdUpNrk+MsbpCYtIvf9SBJdiUey4qE7BXviJsJR4nDQxCZ+3yaYNW3guz/Pw==} - engines: {node: '>= 8.0.0'} - dev: true - - /mri@1.2.0: - resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} - engines: {node: '>=4'} - dev: true - - /ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - /ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - dev: true - - /mute-stream@0.0.8: - resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} - dev: false - - /mz@2.7.0: - resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - dependencies: - any-promise: 1.3.0 - object-assign: 4.1.1 - thenify-all: 1.6.0 - dev: true - - /nanoid@3.3.6: - resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - /natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - dev: true - - /natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - dev: true - - /neo-async@2.6.2: - resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - - /next-tick@1.1.0: - resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} - dev: false - - /next@13.4.2(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-aNFqLs3a3nTGvLWlO9SUhCuMUHVPSFQC0+tDNGAsDXqx+WJDFSbvc233gOJ5H19SBc7nw36A9LwQepOJ2u/8Kg==} - engines: {node: '>=16.8.0'} - hasBin: true - peerDependencies: - '@opentelemetry/api': ^1.1.0 - fibers: '>= 3.1.0' - node-sass: ^6.0.0 || ^7.0.0 - react: ^18.2.0 - react-dom: ^18.2.0 - sass: ^1.3.0 - peerDependenciesMeta: - '@opentelemetry/api': - optional: true - fibers: - optional: true - node-sass: - optional: true - sass: - optional: true - dependencies: - '@next/env': 13.4.2 - '@swc/helpers': 0.5.1 - busboy: 1.6.0 - caniuse-lite: 1.0.30001505 - postcss: 8.4.14 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - styled-jsx: 5.1.1(react@18.2.0) - zod: 3.21.4 - optionalDependencies: - '@next/swc-darwin-arm64': 13.4.2 - '@next/swc-darwin-x64': 13.4.2 - '@next/swc-linux-arm64-gnu': 13.4.2 - '@next/swc-linux-arm64-musl': 13.4.2 - '@next/swc-linux-x64-gnu': 13.4.2 - '@next/swc-linux-x64-musl': 13.4.2 - '@next/swc-win32-arm64-msvc': 13.4.2 - '@next/swc-win32-ia32-msvc': 13.4.2 - '@next/swc-win32-x64-msvc': 13.4.2 - transitivePeerDependencies: - - '@babel/core' - - babel-plugin-macros - dev: false - - /node-fetch@2.6.11: - resolution: {integrity: sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - dependencies: - whatwg-url: 5.0.0 - dev: false - - /node-releases@2.0.12: - resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==} - dev: true - - /nodemon@2.0.22: - resolution: {integrity: sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==} - engines: {node: '>=8.10.0'} - hasBin: true - dependencies: - chokidar: 3.5.3 - debug: 3.2.7(supports-color@5.5.0) - ignore-by-default: 1.0.1 - minimatch: 3.1.2 - pstree.remy: 1.1.8 - semver: 5.7.1 - simple-update-notifier: 1.1.0 - supports-color: 5.5.0 - touch: 3.1.0 - undefsafe: 2.0.5 - dev: true - - /nopt@1.0.10: - resolution: {integrity: sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==} - hasBin: true - dependencies: - abbrev: 1.1.1 - dev: true - - /nopt@7.2.0: - resolution: {integrity: sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true - dependencies: - abbrev: 2.0.0 - dev: true - - /normalize-package-data@2.5.0: - resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} - dependencies: - hosted-git-info: 2.8.9 - resolve: 1.22.2 - semver: 5.7.1 - validate-npm-package-license: 3.0.4 - dev: true - - /normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - dev: true - - /normalize-range@0.1.2: - resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} - engines: {node: '>=0.10.0'} - dev: true - - /npm-normalize-package-bin@3.0.1: - resolution: {integrity: sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: true - - /npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} - engines: {node: '>=8'} - dependencies: - path-key: 3.1.1 - - /npm-run-path@5.1.0: - resolution: {integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - path-key: 4.0.0 - dev: true - - /nth-check@2.1.1: - resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - dependencies: - boolbase: 1.0.0 - dev: true - - /object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - /object-hash@3.0.0: - resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} - engines: {node: '>= 6'} - dev: true - - /object-inspect@1.12.3: - resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} - - /object-is@1.1.5: - resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - dev: true - - /object-keys@1.1.1: - resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} - engines: {node: '>= 0.4'} - dev: true - - /object.assign@4.1.4: - resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - has-symbols: 1.0.3 - object-keys: 1.1.1 - dev: true - - /object.entries@1.1.6: - resolution: {integrity: sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - dev: true - - /object.fromentries@2.0.6: - resolution: {integrity: sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - dev: true - - /object.hasown@1.1.2: - resolution: {integrity: sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==} - dependencies: - define-properties: 1.2.0 - es-abstract: 1.21.2 - dev: true - - /object.values@1.1.6: - resolution: {integrity: sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - dev: true - - /objnest@5.1.1: - resolution: {integrity: sha512-C4fjNlHhUQbHiiFpgzvZse3/WUHq356Da3P8NZazg9JpPHFiQP2Y9lmYvpLU06midap0YpNz/MuA8GGSL8G0YQ==} - engines: {node: '>=8', npm: '>=5'} - dependencies: - '@babel/runtime': 7.22.5 - abind: 1.0.5 - extend: 3.0.2 - dev: false - - /once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - dependencies: - wrappy: 1.0.2 - dev: true - - /onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - dependencies: - mimic-fn: 2.1.0 - - /onetime@6.0.0: - resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} - engines: {node: '>=12'} - dependencies: - mimic-fn: 4.0.0 - dev: true - - /open@9.1.0: - resolution: {integrity: sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==} - engines: {node: '>=14.16'} - dependencies: - default-browser: 4.0.0 - define-lazy-prop: 3.0.0 - is-inside-container: 1.0.0 - is-wsl: 2.2.0 - dev: true - - /openapi-typescript-codegen@0.24.0: - resolution: {integrity: sha512-rSt8t1XbMWhv6Db7GUI24NNli7FU5kzHLxcE8BpzgGWRdWyWt9IB2YoLyPahxNrVA7yOaVgnXPkrcTDRMQtJYg==} - hasBin: true - dependencies: - camelcase: 6.3.0 - commander: 10.0.1 - fs-extra: 11.1.1 - handlebars: 4.7.7 - json-schema-ref-parser: 9.0.9 - dev: true - - /openapi-typescript@6.2.8: - resolution: {integrity: sha512-yA+y5MHiu6cjmtsGfNLavzVuvGCKzjL3H+exgHDPK6bnp6ZVFibtAiafenNSRDWL0x+7Sw/VPv5SbaqiPLW46w==} - hasBin: true - dependencies: - ansi-colors: 4.1.3 - fast-glob: 3.2.12 - js-yaml: 4.1.0 - supports-color: 9.3.1 - undici: 5.22.1 - yargs-parser: 21.1.1 - dev: true - - /optionator@0.9.1: - resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} - engines: {node: '>= 0.8.0'} - dependencies: - deep-is: 0.1.4 - fast-levenshtein: 2.0.6 - levn: 0.4.1 - prelude-ls: 1.2.1 - type-check: 0.4.0 - word-wrap: 1.2.3 - dev: true - - /os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - /outdent@0.5.0: - resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} - dev: true - - /p-filter@2.1.0: - resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} - engines: {node: '>=8'} - dependencies: - p-map: 2.1.0 - dev: true - - /p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} - dependencies: - p-try: 2.2.0 - - /p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} - dependencies: - yocto-queue: 0.1.0 - dev: true - - /p-locate@3.0.0: - resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} - engines: {node: '>=6'} - dependencies: - p-limit: 2.3.0 - dev: false - - /p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} - dependencies: - p-limit: 2.3.0 - dev: true - - /p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} - dependencies: - p-limit: 3.1.0 - dev: true - - /p-map@2.1.0: - resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} - engines: {node: '>=6'} - dev: true - - /p-map@4.0.0: - resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} - engines: {node: '>=10'} - dependencies: - aggregate-error: 3.1.0 - dev: true - - /p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - - /parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} - dependencies: - callsites: 3.1.0 - dev: true - - /parse-entities@1.2.2: - resolution: {integrity: sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg==} - dependencies: - character-entities: 1.2.4 - character-entities-legacy: 1.1.4 - character-reference-invalid: 1.1.4 - is-alphanumerical: 1.0.4 - is-decimal: 1.0.4 - is-hexadecimal: 1.0.4 - dev: false - - /parse-entities@2.0.0: - resolution: {integrity: sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==} - dependencies: - character-entities: 1.2.4 - character-entities-legacy: 1.1.4 - character-reference-invalid: 1.1.4 - is-alphanumerical: 1.0.4 - is-decimal: 1.0.4 - is-hexadecimal: 1.0.4 - dev: true - - /parse-entities@4.0.1: - resolution: {integrity: sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==} - dependencies: - '@types/unist': 2.0.6 - character-entities: 2.0.2 - character-entities-legacy: 3.0.0 - character-reference-invalid: 2.0.1 - decode-named-character-reference: 1.0.2 - is-alphanumerical: 2.0.1 - is-decimal: 2.0.1 - is-hexadecimal: 2.0.1 - dev: true - - /parse-json@5.2.0: - resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} - engines: {node: '>=8'} - dependencies: - '@babel/code-frame': 7.22.5 - error-ex: 1.3.2 - json-parse-even-better-errors: 2.3.1 - lines-and-columns: 1.2.4 - dev: true - - /parse-json@6.0.2: - resolution: {integrity: sha512-SA5aMiaIjXkAiBrW/yPgLgQAQg42f7K3ACO+2l/zOvtQBwX58DMUsFJXelW2fx3yMBmWOVkR6j1MGsdSbCA4UA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - '@babel/code-frame': 7.22.5 - error-ex: 1.3.2 - json-parse-even-better-errors: 2.3.1 - lines-and-columns: 2.0.3 - dev: true - - /path-exists@3.0.0: - resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} - engines: {node: '>=4'} - dev: false - - /path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - dev: true - - /path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - dev: true - - /path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - - /path-key@4.0.0: - resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} - engines: {node: '>=12'} - dev: true - - /path-parse@1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - dev: true - - /path-scurry@1.9.2: - resolution: {integrity: sha512-qSDLy2aGFPm8i4rsbHd4MNyTcrzHFsLQykrtbuGRknZZCBBVXSv2tSCDN2Cg6Rt/GFRw8GoW9y9Ecw5rIPG1sg==} - engines: {node: '>=16 || 14 >=14.17'} - dependencies: - lru-cache: 9.1.2 - minipass: 6.0.2 - dev: true - - /path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - - /picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - /pidtree@0.6.0: - resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} - engines: {node: '>=0.10'} - hasBin: true - dev: true - - /pify@2.3.0: - resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} - engines: {node: '>=0.10.0'} - dev: true - - /pify@3.0.0: - resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} - engines: {node: '>=4'} - dev: false - - /pify@4.0.1: - resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} - engines: {node: '>=6'} - dev: true - - /pirates@4.0.6: - resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} - engines: {node: '>= 6'} - dev: true - - /pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} - dependencies: - find-up: 4.1.0 - dev: true - - /pkg-up@3.1.0: - resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} - engines: {node: '>=8'} - dependencies: - find-up: 3.0.0 - dev: false - - /pluralize@8.0.0: - resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} - engines: {node: '>=4'} - dev: true - - /pnpm@8.5.1: - resolution: {integrity: sha512-W6elL7Nww0a/MCICkzpkbxW6f99TQuX4DuJoDjWp39X08PKDkEpg4cgj3d6EtgYADcdQWl/eM8NdlLJVE3RgpA==} - engines: {node: '>=16.14'} - hasBin: true - dev: true - - /postcss-import@15.1.0(postcss@8.4.24): - resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} - engines: {node: '>=14.0.0'} - peerDependencies: - postcss: ^8.0.0 - dependencies: - postcss: 8.4.24 - postcss-value-parser: 4.2.0 - read-cache: 1.0.0 - resolve: 1.22.2 - dev: true - - /postcss-js@4.0.1(postcss@8.4.24): - resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} - engines: {node: ^12 || ^14 || >= 16} - peerDependencies: - postcss: ^8.4.21 - dependencies: - camelcase-css: 2.0.1 - postcss: 8.4.24 - dev: true - - /postcss-load-config@4.0.1(postcss@8.4.24)(ts-node@10.9.1): - resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} - engines: {node: '>= 14'} - peerDependencies: - postcss: '>=8.0.9' - ts-node: '>=9.0.0' - peerDependenciesMeta: - postcss: - optional: true - ts-node: - optional: true - dependencies: - lilconfig: 2.1.0 - postcss: 8.4.24 - ts-node: 10.9.1(@types/node@18.16.12)(typescript@5.0.4) - yaml: 2.3.1 - dev: true - - /postcss-nested@6.0.1(postcss@8.4.24): - resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} - engines: {node: '>=12.0'} - peerDependencies: - postcss: ^8.2.14 - dependencies: - postcss: 8.4.24 - postcss-selector-parser: 6.0.13 - dev: true - - /postcss-selector-parser@6.0.13: - resolution: {integrity: sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==} - engines: {node: '>=4'} - dependencies: - cssesc: 3.0.0 - util-deprecate: 1.0.2 - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - /postcss@8.4.14: - resolution: {integrity: sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.6 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: false - - /postcss@8.4.24: - resolution: {integrity: sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.6 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /preferred-pm@3.0.3: - resolution: {integrity: sha512-+wZgbxNES/KlJs9q40F/1sfOd/j7f1O9JaHcW5Dsn3aUUOZg3L2bjpVUcKV2jvtElYfoTuQiNeMfQJ4kwUAhCQ==} - engines: {node: '>=10'} - dependencies: - find-up: 5.0.0 - find-yarn-workspace-root2: 1.2.16 - path-exists: 4.0.0 - which-pm: 2.0.0 - dev: true - - /prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - dev: true - - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} - hasBin: true - dev: true - - /prismjs@1.17.1: - resolution: {integrity: sha512-PrEDJAFdUGbOP6xK/UsfkC5ghJsPJviKgnQOoxaDbBjwc8op68Quupwt1DeAFoG8GImPhiKXAvvsH7wDSLsu1Q==} - optionalDependencies: - clipboard: 2.0.11 - dev: false - - /prismjs@1.29.0: - resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} - engines: {node: '>=6'} - dev: false - - /proc-log@3.0.0: - resolution: {integrity: sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: true - - /prompts@2.4.2: - resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} - engines: {node: '>= 6'} - dependencies: - kleur: 3.0.3 - sisteransi: 1.0.5 - dev: true - - /prop-types@15.8.1: - resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} - dependencies: - loose-envify: 1.4.0 - object-assign: 4.1.1 - react-is: 16.13.1 - - /property-information@5.6.0: - resolution: {integrity: sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==} - dependencies: - xtend: 4.0.2 - dev: false - - /pseudomap@1.0.2: - resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} - dev: true - - /pstree.remy@1.1.8: - resolution: {integrity: sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==} - dev: true - - /punycode@2.3.0: - resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} - engines: {node: '>=6'} - dev: true - - /qs@6.11.2: - resolution: {integrity: sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==} - engines: {node: '>=0.6'} - dependencies: - side-channel: 1.0.4 - dev: false - - /queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - /quick-lru@4.0.1: - resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} - engines: {node: '>=8'} - dev: true - - /react-code-blocks@0.0.9-0(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0): - resolution: {integrity: sha512-jdYJVZwGtsr6WIUaqILy5fkF1acf57YV5s0V3+w5o9v3omYnqBeO6EuZi1Vf2x1hahkYGEedsp46+ofdkYlqyw==} - engines: {node: '>=12'} - peerDependencies: - react: '>=16' - dependencies: - '@babel/runtime': 7.22.5 - react: 18.2.0 - react-syntax-highlighter: 12.2.1(react@18.2.0) - styled-components: 5.3.11(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0) - tslib: 2.5.3 - transitivePeerDependencies: - - react-dom - - react-is - dev: false - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: false - - /react-is@16.13.1: - resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} - - /react-syntax-highlighter@12.2.1(react@18.2.0): - resolution: {integrity: sha512-CTsp0ZWijwKRYFg9xhkWD4DSpQqE4vb2NKVMdPAkomnILSmsNBHE0n5GuI5zB+PU3ySVvXvdt9jo+ViD9XibCA==} - peerDependencies: - react: '>= 0.14.0' - dependencies: - '@babel/runtime': 7.22.5 - highlight.js: 9.15.10 - lowlight: 1.12.1 - prismjs: 1.29.0 - react: 18.2.0 - refractor: 2.10.1 - dev: false - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: false - - /read-cache@1.0.0: - resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} - dependencies: - pify: 2.3.0 - dev: true - - /read-package-json-fast@3.0.2: - resolution: {integrity: sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - json-parse-even-better-errors: 3.0.0 - npm-normalize-package-bin: 3.0.1 - dev: true - - /read-pkg-up@7.0.1: - resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} - engines: {node: '>=8'} - dependencies: - find-up: 4.1.0 - read-pkg: 5.2.0 - type-fest: 0.8.1 - dev: true - - /read-pkg@5.2.0: - resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} - engines: {node: '>=8'} - dependencies: - '@types/normalize-package-data': 2.4.1 - normalize-package-data: 2.5.0 - parse-json: 5.2.0 - type-fest: 0.6.0 - dev: true - - /read-yaml-file@1.1.0: - resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} - engines: {node: '>=6'} - dependencies: - graceful-fs: 4.2.11 - js-yaml: 3.14.1 - pify: 4.0.1 - strip-bom: 3.0.0 - dev: true - - /readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - dev: true - - /readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} - dependencies: - picomatch: 2.3.1 - dev: true - - /redent@3.0.0: - resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} - engines: {node: '>=8'} - dependencies: - indent-string: 4.0.0 - strip-indent: 3.0.0 - dev: true - - /refractor@2.10.1: - resolution: {integrity: sha512-Xh9o7hQiQlDbxo5/XkOX6H+x/q8rmlmZKr97Ie1Q8ZM32IRRd3B/UxuA/yXDW79DBSXGWxm2yRTbcTVmAciJRw==} - dependencies: - hastscript: 5.1.2 - parse-entities: 1.2.2 - prismjs: 1.17.1 - dev: false - - /regenerator-runtime@0.11.1: - resolution: {integrity: sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==} - dev: false - - /regenerator-runtime@0.13.11: - resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} - - /regexp-tree@0.1.27: - resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} - hasBin: true - dev: true - - /regexp.prototype.flags@1.5.0: - resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - functions-have-names: 1.2.3 - dev: true - - /regexpp@3.2.0: - resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} - engines: {node: '>=8'} - dev: true - - /regjsparser@0.10.0: - resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} - hasBin: true - dependencies: - jsesc: 0.5.0 - dev: true - - /remark-mdx@2.3.0: - resolution: {integrity: sha512-g53hMkpM0I98MU266IzDFMrTD980gNF3BJnkyFcmN+dD873mQeD5rdMO3Y2X+x8umQfbSE0PcoEDl7ledSA+2g==} - dependencies: - mdast-util-mdx: 2.0.1 - micromark-extension-mdxjs: 1.0.1 - transitivePeerDependencies: - - supports-color - dev: true - - /remark-parse@10.0.2: - resolution: {integrity: sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==} - dependencies: - '@types/mdast': 3.0.11 - mdast-util-from-markdown: 1.3.1 - unified: 10.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /remark-stringify@10.0.3: - resolution: {integrity: sha512-koyOzCMYoUHudypbj4XpnAKFbkddRMYZHwghnxd7ue5210WzGw6kOBwauJTRUMq16jsovXx8dYNvSSWP89kZ3A==} - dependencies: - '@types/mdast': 3.0.11 - mdast-util-to-markdown: 1.5.0 - unified: 10.1.2 - dev: true - - /require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - /require-main-filename@2.0.0: - resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} - - /requireindex@1.2.0: - resolution: {integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==} - engines: {node: '>=0.10.5'} - dev: true - - /resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - dev: true - - /resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - dev: true - - /resolve-pkg-maps@1.0.0: - resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - dev: true - - /resolve@1.19.0: - resolution: {integrity: sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==} - dependencies: - is-core-module: 2.12.1 - path-parse: 1.0.7 - dev: true - - /resolve@1.22.2: - resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} - hasBin: true - dependencies: - is-core-module: 2.12.1 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - dev: true - - /resolve@1.22.3: - resolution: {integrity: sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==} - hasBin: true - dependencies: - is-core-module: 2.12.1 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - dev: true - - /resolve@2.0.0-next.4: - resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==} - hasBin: true - dependencies: - is-core-module: 2.12.1 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - dev: true - - /restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - /reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - /rfdc@1.3.0: - resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==} - dev: true - - /rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - dependencies: - glob: 7.2.3 - dev: true - - /rimraf@5.0.1: - resolution: {integrity: sha512-OfFZdwtd3lZ+XZzYP/6gTACubwFcHdLRqS9UX3UwpU2dnGQYkPFISRwvM3w9IiB2w7bW5qGo/uAwE4SmXXSKvg==} - engines: {node: '>=14'} - hasBin: true - dependencies: - glob: 10.2.7 - dev: true - - /run-applescript@5.0.0: - resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==} - engines: {node: '>=12'} - dependencies: - execa: 5.1.1 - dev: true - - /run-async@2.4.1: - resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} - engines: {node: '>=0.12.0'} - dev: false - - /run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - dependencies: - queue-microtask: 1.2.3 - - /rxjs-report-usage@1.0.6: - resolution: {integrity: sha512-omv1DIv5z1kV+zDAEjaDjWSkx8w5TbFp5NZoPwUipwzYVcor/4So9ZU3bUyQ1c8lxY5Q0Es/ztWW7PGjY7to0Q==} - hasBin: true - dependencies: - '@babel/parser': 7.22.5 - '@babel/traverse': 7.22.5(supports-color@5.5.0) - '@babel/types': 7.22.5 - bent: 7.3.12 - chalk: 4.1.2 - glob: 7.2.3 - prompts: 2.4.2 - transitivePeerDependencies: - - supports-color - dev: true - - /rxjs@6.6.7: - resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} - engines: {npm: '>=2.0.0'} - dependencies: - tslib: 1.14.1 - dev: false - - /rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - dependencies: - tslib: 2.5.3 - - /sade@1.8.1: - resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} - engines: {node: '>=6'} - dependencies: - mri: 1.2.0 - dev: true - - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: true - - /safe-regex-test@1.0.0: - resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.1 - is-regex: 1.1.4 - dev: true - - /safe-regex@2.1.1: - resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} - dependencies: - regexp-tree: 0.1.27 - dev: true - - /safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: false - - /select@1.1.2: - resolution: {integrity: sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==} - dev: false - optional: true - - /semver@5.7.1: - resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} - hasBin: true - dev: true - - /semver@6.3.0: - resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} - hasBin: true - dev: true - - /semver@7.0.0: - resolution: {integrity: sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==} - hasBin: true - dev: true - - /semver@7.5.2: - resolution: {integrity: sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==} - engines: {node: '>=10'} - hasBin: true - dependencies: - lru-cache: 6.0.0 - dev: true - - /semver@7.5.3: - resolution: {integrity: sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==} - engines: {node: '>=10'} - hasBin: true - dependencies: - lru-cache: 6.0.0 - dev: true - - /set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: false - - /shebang-command@1.2.0: - resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} - engines: {node: '>=0.10.0'} - dependencies: - shebang-regex: 1.0.0 - dev: true - - /shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - dependencies: - shebang-regex: 3.0.0 - - /shebang-regex@1.0.0: - resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} - engines: {node: '>=0.10.0'} - dev: true - - /shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - - /shiki@0.12.1: - resolution: {integrity: sha512-aieaV1m349rZINEBkjxh2QbBvFFQOlgqYTNtCal82hHj4dDZ76oMlQIX+C7ryerBTDiga3e5NfH6smjdJ02BbQ==} - dependencies: - jsonc-parser: 3.2.0 - vscode-oniguruma: 1.7.0 - vscode-textmate: 8.0.0 - dev: true - - /shiki@0.14.2: - resolution: {integrity: sha512-ltSZlSLOuSY0M0Y75KA+ieRaZ0Trf5Wl3gutE7jzLuIcWxLp5i/uEnLoQWNvgKXQ5OMpGkJnVMRLAuzjc0LJ2A==} - dependencies: - ansi-sequence-parser: 1.1.0 - jsonc-parser: 3.2.0 - vscode-oniguruma: 1.7.0 - vscode-textmate: 8.0.0 - dev: true - - /side-channel@1.0.4: - resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.1 - object-inspect: 1.12.3 - - /signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - /signal-exit@4.0.2: - resolution: {integrity: sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==} - engines: {node: '>=14'} - dev: true - - /simple-update-notifier@1.1.0: - resolution: {integrity: sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==} - engines: {node: '>=8.10.0'} - dependencies: - semver: 7.0.0 - dev: true - - /sisteransi@1.0.5: - resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} - dev: true - - /slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - - /slash@4.0.0: - resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} - engines: {node: '>=12'} - dev: true - - /slice-ansi@3.0.0: - resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} - engines: {node: '>=8'} - dependencies: - ansi-styles: 4.3.0 - astral-regex: 2.0.0 - is-fullwidth-code-point: 3.0.0 - dev: true - - /slice-ansi@4.0.0: - resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - astral-regex: 2.0.0 - is-fullwidth-code-point: 3.0.0 - dev: true - - /slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - dev: true - - /smartwrap@2.0.2: - resolution: {integrity: sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==} - engines: {node: '>=6'} - hasBin: true - dependencies: - array.prototype.flat: 1.3.1 - breakword: 1.0.6 - grapheme-splitter: 1.0.4 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - yargs: 15.4.1 - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - - /source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - - /space-separated-tokens@1.1.5: - resolution: {integrity: sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==} - dev: false - - /spawndamnit@2.0.0: - resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} - dependencies: - cross-spawn: 5.1.0 - signal-exit: 3.0.7 - dev: true - - /spdx-correct@3.2.0: - resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} - dependencies: - spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.13 - dev: true - - /spdx-exceptions@2.3.0: - resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} - dev: true - - /spdx-expression-parse@3.0.1: - resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - dependencies: - spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.13 - dev: true - - /spdx-license-ids@3.0.13: - resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} - dev: true - - /sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - dev: true - - /stop-iteration-iterator@1.0.0: - resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} - engines: {node: '>= 0.4'} - dependencies: - internal-slot: 1.0.5 - dev: true - - /stream-transform@2.1.3: - resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} - dependencies: - mixme: 0.5.9 - dev: true - - /streamsearch@1.1.0: - resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} - engines: {node: '>=10.0.0'} - - /string-argv@0.3.2: - resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} - engines: {node: '>=0.6.19'} - dev: true - - /string-width@3.1.0: - resolution: {integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==} - engines: {node: '>=6'} - dependencies: - emoji-regex: 7.0.3 - is-fullwidth-code-point: 2.0.0 - strip-ansi: 5.2.0 - dev: false - - /string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - /string-width@5.1.2: - resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} - engines: {node: '>=12'} - dependencies: - eastasianwidth: 0.2.0 - emoji-regex: 9.2.2 - strip-ansi: 7.1.0 - dev: true - - /string.prototype.matchall@4.0.8: - resolution: {integrity: sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - get-intrinsic: 1.2.1 - has-symbols: 1.0.3 - internal-slot: 1.0.5 - regexp.prototype.flags: 1.5.0 - side-channel: 1.0.4 - dev: true - - /string.prototype.trim@1.2.7: - resolution: {integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - dev: true - - /string.prototype.trimend@1.0.6: - resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - dev: true - - /string.prototype.trimstart@1.0.6: - resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.2 - dev: true - - /string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - dependencies: - safe-buffer: 5.2.1 - dev: true - - /stringcase@4.3.1: - resolution: {integrity: sha512-Ov7McNX1sFaEX9NWijD1hIOVDDhKdnFzN9tvoa1N8xgrclouhsO4kBPVrTPhjO/zP5mn1Ww03uZ2SThNMXS7zg==} - engines: {node: '>=8', npm: '>=5'} - dev: false - - /stringify-entities@4.0.3: - resolution: {integrity: sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==} - dependencies: - character-entities-html4: 2.1.0 - character-entities-legacy: 3.0.0 - dev: true - - /strip-ansi@5.2.0: - resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} - engines: {node: '>=6'} - dependencies: - ansi-regex: 4.1.1 - dev: false - - /strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - dependencies: - ansi-regex: 5.0.1 - - /strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - dependencies: - ansi-regex: 6.0.1 - dev: true - - /strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} - dev: true - - /strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} - - /strip-final-newline@3.0.0: - resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} - engines: {node: '>=12'} - dev: true - - /strip-indent@3.0.0: - resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} - engines: {node: '>=8'} - dependencies: - min-indent: 1.0.1 - dev: true - - /strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - dev: true - - /styled-components@5.3.11(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0): - resolution: {integrity: sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==} - engines: {node: '>=10'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - react-is: '>= 16.8.0' - dependencies: - '@babel/helper-module-imports': 7.22.5 - '@babel/traverse': 7.22.5(supports-color@5.5.0) - '@emotion/is-prop-valid': 1.2.1 - '@emotion/stylis': 0.8.5 - '@emotion/unitless': 0.7.5 - babel-plugin-styled-components: 2.1.3(styled-components@5.3.11) - css-to-react-native: 3.2.0 - hoist-non-react-statics: 3.3.2 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - react-is: 16.13.1 - shallowequal: 1.1.0 - supports-color: 5.5.0 - dev: false - - /styled-jsx@5.1.1(react@18.2.0): - resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} - engines: {node: '>= 12.0.0'} - peerDependencies: - '@babel/core': '*' - babel-plugin-macros: '*' - react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' - peerDependenciesMeta: - '@babel/core': - optional: true - babel-plugin-macros: - optional: true - dependencies: - client-only: 0.0.1 - react: 18.2.0 - dev: false - - /sucrase@3.32.0: - resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==} - engines: {node: '>=8'} - hasBin: true - dependencies: - '@jridgewell/gen-mapping': 0.3.3 - commander: 4.1.1 - glob: 7.1.6 - lines-and-columns: 1.2.4 - mz: 2.7.0 - pirates: 4.0.6 - ts-interface-checker: 0.1.13 - dev: true - - /supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} - dependencies: - has-flag: 3.0.0 - - /supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - dependencies: - has-flag: 4.0.0 - - /supports-color@9.3.1: - resolution: {integrity: sha512-knBY82pjmnIzK3NifMo3RxEIRD9E0kIzV4BKcyTZ9+9kWgLMxd4PrsTSMoFQUabgRBbF8KOLRDCyKgNV+iK44Q==} - engines: {node: '>=12'} - dev: true - - /supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - dev: true - - /svelte@3.59.2: - resolution: {integrity: sha512-vzSyuGr3eEoAtT/A6bmajosJZIUWySzY2CzB3w2pgPvnkUjGqlDnsNnA0PMO+mMAhuyMul6C2uuZzY6ELSkzyA==} - engines: {node: '>= 8'} - dev: true - - /synckit@0.8.5: - resolution: {integrity: sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==} - engines: {node: ^14.18.0 || >=16.0.0} - dependencies: - '@pkgr/utils': 2.4.1 - tslib: 2.5.3 - dev: true - - /tailwindcss@3.3.2(ts-node@10.9.1): - resolution: {integrity: sha512-9jPkMiIBXvPc2KywkraqsUfbfj+dHDb+JPWtSJa9MLFdrPyazI7q6WX2sUrm7R9eVR7qqv3Pas7EvQFzxKnI6w==} - engines: {node: '>=14.0.0'} - hasBin: true - dependencies: - '@alloc/quick-lru': 5.2.0 - arg: 5.0.2 - chokidar: 3.5.3 - didyoumean: 1.2.2 - dlv: 1.1.3 - fast-glob: 3.2.12 - glob-parent: 6.0.2 - is-glob: 4.0.3 - jiti: 1.18.2 - lilconfig: 2.1.0 - micromatch: 4.0.5 - normalize-path: 3.0.0 - object-hash: 3.0.0 - picocolors: 1.0.0 - postcss: 8.4.24 - postcss-import: 15.1.0(postcss@8.4.24) - postcss-js: 4.0.1(postcss@8.4.24) - postcss-load-config: 4.0.1(postcss@8.4.24)(ts-node@10.9.1) - postcss-nested: 6.0.1(postcss@8.4.24) - postcss-selector-parser: 6.0.13 - postcss-value-parser: 4.2.0 - resolve: 1.22.2 - sucrase: 3.32.0 - transitivePeerDependencies: - - ts-node - dev: true - - /tapable@2.2.1: - resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} - engines: {node: '>=6'} - dev: true - - /term-size@2.2.1: - resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} - engines: {node: '>=8'} - dev: true - - /text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - dev: true - - /thenify-all@1.6.0: - resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} - engines: {node: '>=0.8'} - dependencies: - thenify: 3.3.1 - dev: true - - /thenify@3.3.1: - resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - dependencies: - any-promise: 1.3.0 - dev: true - - /through@2.3.8: - resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} - - /timers-ext@0.1.7: - resolution: {integrity: sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==} - dependencies: - es5-ext: 0.10.62 - next-tick: 1.1.0 - dev: false - - /tiny-emitter@2.1.0: - resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} - dev: false - optional: true - - /titleize@3.0.0: - resolution: {integrity: sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==} - engines: {node: '>=12'} - dev: true - - /tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - dependencies: - os-tmpdir: 1.0.2 - - /to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - - /to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - dependencies: - is-number: 7.0.0 - - /to-vfile@7.2.4: - resolution: {integrity: sha512-2eQ+rJ2qGbyw3senPI0qjuM7aut8IYXK6AEoOWb+fJx/mQYzviTckm1wDjq91QYHAPBTYzmdJXxMFA6Mk14mdw==} - dependencies: - is-buffer: 2.0.5 - vfile: 5.3.7 - dev: true - - /touch@3.1.0: - resolution: {integrity: sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==} - hasBin: true - dependencies: - nopt: 1.0.10 - dev: true - - /tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - dev: false - - /trim-newlines@3.0.1: - resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} - engines: {node: '>=8'} - dev: true - - /trough@2.1.0: - resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} - dev: true - - /ts-interface-checker@0.1.13: - resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - dev: true - - /ts-node@10.9.1(@types/node@18.16.12)(typescript@5.0.4): - resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.9 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 18.16.12 - acorn: 8.9.0 - acorn-walk: 8.2.0 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.0.4 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - dev: true - - /tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - - /tslib@2.5.3: - resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==} - - /tsutils-etc@1.4.2(tsutils@3.21.0)(typescript@5.0.4): - resolution: {integrity: sha512-2Dn5SxTDOu6YWDNKcx1xu2YUy6PUeKrWZB/x2cQ8vY2+iz3JRembKn/iZ0JLT1ZudGNwQQvtFX9AwvRHbXuPUg==} - hasBin: true - peerDependencies: - tsutils: ^3.0.0 - typescript: '>=4.0.0' - dependencies: - '@types/yargs': 17.0.24 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 - yargs: 17.7.2 - dev: true - - /tsutils@3.21.0(typescript@5.0.4): - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - dependencies: - tslib: 1.14.1 - typescript: 5.0.4 - dev: true - - /tty-table@4.2.1: - resolution: {integrity: sha512-xz0uKo+KakCQ+Dxj1D/tKn2FSyreSYWzdkL/BYhgN6oMW808g8QRMuh1atAV9fjTPbWBjfbkKQpI/5rEcnAc7g==} - engines: {node: '>=8.0.0'} - hasBin: true - dependencies: - chalk: 4.1.2 - csv: 5.5.3 - kleur: 4.1.5 - smartwrap: 2.0.2 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - yargs: 17.7.2 - dev: true - - /type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} - dependencies: - prelude-ls: 1.2.1 - dev: true - - /type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - dev: true - - /type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - dev: true - - /type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - /type-fest@0.6.0: - resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} - engines: {node: '>=8'} - dev: true - - /type-fest@0.8.1: - resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} - engines: {node: '>=8'} - dev: true - - /type@1.2.0: - resolution: {integrity: sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==} - dev: false - - /type@2.7.2: - resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} - dev: false - - /typed-array-length@1.0.4: - resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} - dependencies: - call-bind: 1.0.2 - for-each: 0.3.3 - is-typed-array: 1.1.10 - dev: true - - /typed-emitter@2.1.0: - resolution: {integrity: sha512-g/KzbYKbH5C2vPkaXGu8DJlHrGKHLsM25Zg9WuC9pMGfuvT+X25tZQWo5fK1BjBm8+UrVE9LDCvaY0CQk+fXDA==} - optionalDependencies: - rxjs: 7.8.1 - dev: false - - /typedarray@0.0.6: - resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - dev: true - - /typedoc@0.23.24(typescript@5.0.4): - resolution: {integrity: sha512-bfmy8lNQh+WrPYcJbtjQ6JEEsVl/ce1ZIXyXhyW+a1vFrjO39t6J8sL/d6FfAGrJTc7McCXgk9AanYBSNvLdIA==} - engines: {node: '>= 14.14'} - hasBin: true - peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x - dependencies: - lunr: 2.3.9 - marked: 4.3.0 - minimatch: 5.1.6 - shiki: 0.12.1 - typescript: 5.0.4 - dev: true - - /typedoc@0.24.7(typescript@5.0.4): - resolution: {integrity: sha512-zzfKDFIZADA+XRIp2rMzLe9xZ6pt12yQOhCr7cD7/PBTjhPmMyMvGrkZ2lPNJitg3Hj1SeiYFNzCsSDrlpxpKw==} - engines: {node: '>= 14.14'} - hasBin: true - peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x - dependencies: - lunr: 2.3.9 - marked: 4.3.0 - minimatch: 9.0.1 - shiki: 0.14.2 - typescript: 5.0.4 - dev: true - - /typescript@5.0.4: - resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} - engines: {node: '>=12.20'} - hasBin: true - dev: true - - /uglify-js@3.17.4: - resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} - engines: {node: '>=0.8.0'} - hasBin: true - requiresBuild: true - optional: true - - /unbox-primitive@1.0.2: - resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} - dependencies: - call-bind: 1.0.2 - has-bigints: 1.0.2 - has-symbols: 1.0.3 - which-boxed-primitive: 1.0.2 - dev: true - - /undefsafe@2.0.5: - resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==} - dev: true - - /undici@5.22.1: - resolution: {integrity: sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==} - engines: {node: '>=14.0'} - dependencies: - busboy: 1.6.0 - dev: true - - /unified-engine@10.1.0: - resolution: {integrity: sha512-5+JDIs4hqKfHnJcVCxTid1yBoI/++FfF/1PFdSMpaftZZZY+qg2JFruRbf7PaIwa9KgLotXQV3gSjtY0IdcFGQ==} - dependencies: - '@types/concat-stream': 2.0.0 - '@types/debug': 4.1.8 - '@types/is-empty': 1.2.1 - '@types/node': 18.16.12 - '@types/unist': 2.0.6 - concat-stream: 2.0.0 - debug: 4.3.4(supports-color@5.5.0) - fault: 2.0.1 - glob: 8.1.0 - ignore: 5.2.4 - is-buffer: 2.0.5 - is-empty: 1.2.0 - is-plain-obj: 4.1.0 - load-plugin: 5.1.0 - parse-json: 6.0.2 - to-vfile: 7.2.4 - trough: 2.1.0 - unist-util-inspect: 7.0.2 - vfile-message: 3.1.4 - vfile-reporter: 7.0.5 - vfile-statistics: 2.0.1 - yaml: 2.3.1 - transitivePeerDependencies: - - supports-color - dev: true - - /unified@10.1.2: - resolution: {integrity: sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==} - dependencies: - '@types/unist': 2.0.6 - bail: 2.0.2 - extend: 3.0.2 - is-buffer: 2.0.5 - is-plain-obj: 4.1.0 - trough: 2.1.0 - vfile: 5.3.7 - dev: true - - /unist-util-inspect@7.0.2: - resolution: {integrity: sha512-Op0XnmHUl6C2zo/yJCwhXQSm/SmW22eDZdWP2qdf4WpGrgO1ZxFodq+5zFyeRGasFjJotAnLgfuD1jkcKqiH1Q==} - dependencies: - '@types/unist': 2.0.6 - dev: true - - /unist-util-is@5.2.1: - resolution: {integrity: sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==} - dependencies: - '@types/unist': 2.0.6 - dev: true - - /unist-util-position-from-estree@1.1.2: - resolution: {integrity: sha512-poZa0eXpS+/XpoQwGwl79UUdea4ol2ZuCYguVaJS4qzIOMDzbqz8a3erUCOmubSZkaOuGamb3tX790iwOIROww==} - dependencies: - '@types/unist': 2.0.6 - dev: true - - /unist-util-remove-position@4.0.2: - resolution: {integrity: sha512-TkBb0HABNmxzAcfLf4qsIbFbaPDvMO6wa3b3j4VcEzFVaw1LBKwnW4/sRJ/atSLSzoIg41JWEdnE7N6DIhGDGQ==} - dependencies: - '@types/unist': 2.0.6 - unist-util-visit: 4.1.2 - dev: true - - /unist-util-stringify-position@2.0.3: - resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} - dependencies: - '@types/unist': 2.0.6 - dev: true - - /unist-util-stringify-position@3.0.3: - resolution: {integrity: sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==} - dependencies: - '@types/unist': 2.0.6 - dev: true - - /unist-util-visit-parents@5.1.3: - resolution: {integrity: sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==} - dependencies: - '@types/unist': 2.0.6 - unist-util-is: 5.2.1 - dev: true - - /unist-util-visit@4.1.2: - resolution: {integrity: sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==} - dependencies: - '@types/unist': 2.0.6 - unist-util-is: 5.2.1 - unist-util-visit-parents: 5.1.3 - dev: true - - /universalify@0.1.2: - resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} - engines: {node: '>= 4.0.0'} - dev: true - - /universalify@2.0.0: - resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} - engines: {node: '>= 10.0.0'} - dev: true - - /untildify@4.0.0: - resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} - engines: {node: '>=8'} - dev: true - - /update-browserslist-db@1.0.11(browserslist@4.21.9): - resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - dependencies: - browserslist: 4.21.9 - escalade: 3.1.1 - picocolors: 1.0.0 - dev: true - - /uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - dependencies: - punycode: 2.3.0 - dev: true - - /util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: true - - /util@0.10.3: - resolution: {integrity: sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ==} - dependencies: - inherits: 2.0.1 - dev: true - - /uuid@8.3.2: - resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} - hasBin: true - dev: false - - /uvu@0.5.6: - resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} - engines: {node: '>=8'} - hasBin: true - dependencies: - dequal: 2.0.3 - diff: 5.1.0 - kleur: 4.1.5 - sade: 1.8.1 - dev: true - - /v8-compile-cache-lib@3.0.1: - resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - dev: true - - /validate-npm-package-license@3.0.4: - resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} - dependencies: - spdx-correct: 3.2.0 - spdx-expression-parse: 3.0.1 - dev: true - - /vfile-message@3.1.4: - resolution: {integrity: sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==} - dependencies: - '@types/unist': 2.0.6 - unist-util-stringify-position: 3.0.3 - dev: true - - /vfile-reporter@7.0.5: - resolution: {integrity: sha512-NdWWXkv6gcd7AZMvDomlQbK3MqFWL1RlGzMn++/O2TI+68+nqxCPTvLugdOtfSzXmjh+xUyhp07HhlrbJjT+mw==} - dependencies: - '@types/supports-color': 8.1.1 - string-width: 5.1.2 - supports-color: 9.3.1 - unist-util-stringify-position: 3.0.3 - vfile: 5.3.7 - vfile-message: 3.1.4 - vfile-sort: 3.0.1 - vfile-statistics: 2.0.1 - dev: true - - /vfile-sort@3.0.1: - resolution: {integrity: sha512-1os1733XY6y0D5x0ugqSeaVJm9lYgj0j5qdcZQFyxlZOSy1jYarL77lLyb5gK4Wqr1d5OxmuyflSO3zKyFnTFw==} - dependencies: - vfile: 5.3.7 - vfile-message: 3.1.4 - dev: true - - /vfile-statistics@2.0.1: - resolution: {integrity: sha512-W6dkECZmP32EG/l+dp2jCLdYzmnDBIw6jwiLZSER81oR5AHRcVqL+k3Z+pfH1R73le6ayDkJRMk0sutj1bMVeg==} - dependencies: - vfile: 5.3.7 - vfile-message: 3.1.4 - dev: true - - /vfile@5.3.7: - resolution: {integrity: sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==} - dependencies: - '@types/unist': 2.0.6 - is-buffer: 2.0.5 - unist-util-stringify-position: 3.0.3 - vfile-message: 3.1.4 - dev: true - - /vscode-oniguruma@1.7.0: - resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} - dev: true - - /vscode-textmate@8.0.0: - resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} - dev: true - - /vue-eslint-parser@9.3.1(eslint@8.40.0): - resolution: {integrity: sha512-Clr85iD2XFZ3lJ52/ppmUDG/spxQu6+MAeHXjjyI4I1NUYZ9xmenQp4N0oaHJhrA8OOxltCVxMRfANGa70vU0g==} - engines: {node: ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: '>=6.0.0' - dependencies: - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.40.0 - eslint-scope: 7.2.0 - eslint-visitor-keys: 3.4.1 - espree: 9.5.2 - esquery: 1.5.0 - lodash: 4.17.21 - semver: 7.5.2 - transitivePeerDependencies: - - supports-color - dev: true - - /walk-up-path@3.0.1: - resolution: {integrity: sha512-9YlCL/ynK3CTlrSRrDxZvUauLzAswPCrsaCgilqFevUYpeEW0/3ScEjaa3kbW/T0ghhkEr7mv+fpjqn1Y1YuTA==} - dev: true - - /wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - dependencies: - defaults: 1.0.4 - dev: true - - /webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - dev: false - - /whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - dev: false - - /which-boxed-primitive@1.0.2: - resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} - dependencies: - is-bigint: 1.0.4 - is-boolean-object: 1.1.2 - is-number-object: 1.0.7 - is-string: 1.0.7 - is-symbol: 1.0.4 - dev: true - - /which-collection@1.0.1: - resolution: {integrity: sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==} - dependencies: - is-map: 2.0.2 - is-set: 2.0.2 - is-weakmap: 2.0.1 - is-weakset: 2.0.2 - dev: true - - /which-module@2.0.1: - resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - - /which-pm@2.0.0: - resolution: {integrity: sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==} - engines: {node: '>=8.15'} - dependencies: - load-yaml-file: 0.2.0 - path-exists: 4.0.0 - dev: true - - /which-typed-array@1.1.9: - resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - is-typed-array: 1.1.10 - dev: true - - /which@1.3.1: - resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} - hasBin: true - dependencies: - isexe: 2.0.0 - dev: true - - /which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - dependencies: - isexe: 2.0.0 - - /word-wrap@1.2.3: - resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} - engines: {node: '>=0.10.0'} - dev: true - - /wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} - - /wrap-ansi@5.1.0: - resolution: {integrity: sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==} - engines: {node: '>=6'} - dependencies: - ansi-styles: 3.2.1 - string-width: 3.1.0 - strip-ansi: 5.2.0 - dev: false - - /wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - dev: true - - /wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - dev: true - - /wrap-ansi@8.1.0: - resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} - engines: {node: '>=12'} - dependencies: - ansi-styles: 6.2.1 - string-width: 5.1.2 - strip-ansi: 7.1.0 - dev: true - - /wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - dev: true - - /ws@8.13.0: - resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: false - - /xml-name-validator@4.0.0: - resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} - engines: {node: '>=12'} - dev: true - - /xtend@4.0.2: - resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} - engines: {node: '>=0.4'} - dev: false - - /y18n@4.0.3: - resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} - - /y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - dev: true - - /yallist@2.1.2: - resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} - dev: true - - /yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - dev: true - - /yaml@2.3.1: - resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} - engines: {node: '>= 14'} - dev: true - - /yargs-interactive@3.0.1: - resolution: {integrity: sha512-Jnp88uiuz+ZRpM10Lwvs0nRetWPog+6lcgQrhwKsyEanAe3wgTlaPPzcYlZWp53aOMTzOcR5wEpEsFOMOPmLlw==} - engines: {node: '>=8', npm: '>=6'} - dependencies: - inquirer: 7.3.3 - yargs: 14.2.3 - dev: false - - /yargs-parser@15.0.3: - resolution: {integrity: sha512-/MVEVjTXy/cGAjdtQf8dW3V9b97bPN7rNn8ETj6BmAQL7ibC7O1Q9SPJbGjgh3SlwoBNXMzj/ZGIj8mBgl12YA==} - dependencies: - camelcase: 5.3.1 - decamelize: 1.2.0 - dev: false - - /yargs-parser@18.1.3: - resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} - engines: {node: '>=6'} - dependencies: - camelcase: 5.3.1 - decamelize: 1.2.0 - dev: true - - /yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - dev: true - - /yargs@14.2.3: - resolution: {integrity: sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==} - dependencies: - cliui: 5.0.0 - decamelize: 1.2.0 - find-up: 3.0.0 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - require-main-filename: 2.0.0 - set-blocking: 2.0.0 - string-width: 3.1.0 - which-module: 2.0.1 - y18n: 4.0.3 - yargs-parser: 15.0.3 - dev: false - - /yargs@15.4.1: - resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} - engines: {node: '>=8'} - dependencies: - cliui: 6.0.0 - decamelize: 1.2.0 - find-up: 4.1.0 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - require-main-filename: 2.0.0 - set-blocking: 2.0.0 - string-width: 4.2.3 - which-module: 2.0.1 - y18n: 4.0.3 - yargs-parser: 18.1.3 - dev: true - - /yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - dependencies: - cliui: 8.0.1 - escalade: 3.1.1 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - dev: true - - /yn@3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} - dev: true - - /yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - dev: true - - /zod@3.21.4: - resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==} - dev: false - - /zwitch@2.0.4: - resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} - dev: true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml deleted file mode 100644 index 9ed67691..00000000 --- a/pnpm-workspace.yaml +++ /dev/null @@ -1,5 +0,0 @@ -packages: - - "packages/**" - - "services/**" - - "apps/**" - - "!packages/create-guilded-app/templates/**" diff --git a/services/proxy/package.json b/services/proxy/package.json index abd94b77..5e062b12 100644 --- a/services/proxy/package.json +++ b/services/proxy/package.json @@ -7,7 +7,6 @@ "main": "./dist/index.js", "private": true, "scripts": { - "lint": "eslint --ignore-path ../../.config/.eslintignore --config ../../.config/.eslintrc.js src", "build": "tsc", "docker:build": "docker build -t guildedjs/proxy-service:latest -f ./Dockerfile ../../", "docker:start": "docker run --env-file=.env -p 3456:3456 guildedjs/proxy-service", @@ -59,4 +58,4 @@ "bugs": { "url": "https://github.com/zaida04/guilded.js/issues" } -} +} \ No newline at end of file diff --git a/services/proxy/src/index.ts b/services/proxy/src/index.ts index fe71843d..9c2fd179 100644 --- a/services/proxy/src/index.ts +++ b/services/proxy/src/index.ts @@ -7,62 +7,78 @@ import { config } from "dotenv"; if (process.env.NODE_ENV !== "production") config(); for (const envVar of ["GUILDED_TOKEN"]) { - if (!process.env[envVar]) throw new Error(`Missing environment variable ${envVar}`); + if (!process.env[envVar]) throw new Error(`Missing environment variable ${envVar}`); } const rest = new RestManager({ - maxRatelimitRetryLimit: 0, - token: process.env.GUILDED_TOKEN!, + maxRatelimitRetryLimit: 0, + token: process.env.GUILDED_TOKEN!, }); const server = createServer((req, res) => { - res.setHeader("Content-Type", "application/json"); - if (!req.url || !req.method) { - res.statusCode = 400; - return res.end( - JSON.stringify({ - error: { message: "You must supply a valid path and method." }, - }), - ); - } + res.setHeader("Content-Type", "application/json"); + if (!req.url || !req.method) { + res.statusCode = 400; + return res.end( + JSON.stringify({ + error: { + message: "You must supply a valid path and method.", + }, + }), + ); + } - console.log(`${req.method} ${req.url}`); + console.log(`${req.method} ${req.url}`); - const body: Uint8Array[] = []; - req.on("data", (chunk) => { - body.push(chunk); - }).on("end", async () => { - try { - const [request, requestBody] = await rest.make( - { - path: req.url!, - method: req.method! as HTTPMethods, - body: body.length ? Buffer.concat(body).toString() : undefined, - }, - true, - 0, - { - returnAsText: true, - bodyIsJSON: false, - }, - ); - const resBodyParsed = await requestBody; + const body: Uint8Array[] = []; + req + .on("data", (chunk) => { + body.push(chunk); + }) + .on("end", async () => { + try { + const [request, requestBody] = await rest.make( + { + path: req.url!, + method: req.method! as HTTPMethods, + body: body.length ? Buffer.concat(body).toString() : undefined, + }, + true, + 0, + { + returnAsText: true, + bodyIsJSON: false, + }, + ); + const resBodyParsed = await requestBody; - res.statusCode = request.status; - res.end(resBodyParsed); - } catch (error) { - if (error instanceof GuildedAPIError) { - res.statusCode = Number(error.response.status); - return res.end(JSON.stringify({ error: { message: error.message } })); - } + res.statusCode = request.status; + res.end(resBodyParsed); + } catch (error) { + if (error instanceof GuildedAPIError) { + res.statusCode = Number(error.response.status); + return res.end( + JSON.stringify({ + error: { + message: error.message, + }, + }), + ); + } - res.statusCode = 500; - console.log(error); - return res.end(JSON.stringify({ error: { message: "Internal server error." } })); - } - }); + res.statusCode = 500; + console.log(error); + return res.end( + JSON.stringify({ + error: { + message: "Internal server error.", + }, + }), + ); + } + }); }); const port = process.env.PORT ? Number(process.env.PORT) : 3_456; server.listen(port, () => { - console.log(`Proxy server started on ${port}`); + console.log(`Proxy server started on ${port}`); }); diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json deleted file mode 100644 index 4444ca40..00000000 --- a/tsconfig.eslint.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "./tsconfig.json", - "include": ["packages", "apps", "services", "scripts", "examples"] -} diff --git a/turbo.json b/turbo.json new file mode 100644 index 00000000..d5ab0f1f --- /dev/null +++ b/turbo.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://turbo.build/schema.json", + "pipeline": { + "build:typecheck": { + "dependsOn": [ + "^build:typecheck" + ], + "outputs": [ + "dist" + ], + "inputs": [ + "lib/**/*.{ts,tsx}", + "src/**/*.{ts,tsx}" + ] + }, + "build": { + "dependsOn": [ + "^build" + ], + "outputs": [ + "dist" + ], + "inputs": [ + "lib/**/*.{ts,tsx}", + "src/**/*.{ts,tsx}" + ] + }, + "check": { + "dependsOn": [ + "^check" + ], + "inputs": [ + "**/*.{ts,tsx}" + ] + }, + "check:fix": { + "dependsOn": [ + "^check:fix" + ], + "cache": false + }, + "prepublishOnly": { + "dependsOn": [ + "^prepublishOnly" + ], + "cache": false + } + } +} \ No newline at end of file