From 568b4f29b605c8e6e16f3a74eccab159011f0a13 Mon Sep 17 00:00:00 2001 From: Zeyu Zhang <39144422+zeyu2001@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:32:52 +0800 Subject: [PATCH 1/2] feat: api reports & docs auto-gen api reports and docs --- .github/workflows/docs.yml | 50 ++ .github/workflows/linting.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tests.yml | 5 +- .gitignore | 1 + api-extractor.json | 434 ++++++++++ apps/docs/.vitepress/config.mts | 23 + apps/docs/api/index.md | 31 + apps/docs/api/starter-kitty-validators.md | 81 ++ ...ter-kitty-validators.options.baseorigin.md | 13 + .../api/starter-kitty-validators.options.md | 76 ++ ...rter-kitty-validators.options.whitelist.md | 24 + ...y-validators.optionserror._constructor_.md | 47 ++ .../starter-kitty-validators.optionserror.md | 48 ++ ...dators.urlvalidationerror._constructor_.md | 47 ++ ...ter-kitty-validators.urlvalidationerror.md | 48 ++ ...y-validators.urlvalidator._constructor_.md | 62 ++ .../starter-kitty-validators.urlvalidator.md | 89 ++ ...ter-kitty-validators.urlvalidator.parse.md | 59 ++ apps/docs/index.md | 3 + apps/docs/package.json | 19 + etc/starter-kitty-validators.api.md | 34 + package.json | 5 + packages/validators/api-extractor.json | 21 + packages/validators/package.json | 10 +- packages/validators/src/__tests__/url.test.ts | 3 +- packages/validators/src/index.ts | 8 + packages/validators/src/url/errors.ts | 10 + packages/validators/src/url/index.ts | 15 +- packages/validators/src/url/options.ts | 30 + packages/validators/src/url/utils.ts | 2 +- .../temp/starter-kitty-validators.api.json | 480 +++++++++++ .../temp/starter-kitty-validators.api.md | 34 + pnpm-lock.yaml | 780 ++++++++++++++++++ turbo.json | 9 + 35 files changed, 2584 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 api-extractor.json create mode 100644 apps/docs/.vitepress/config.mts create mode 100644 apps/docs/api/index.md create mode 100644 apps/docs/api/starter-kitty-validators.md create mode 100644 apps/docs/api/starter-kitty-validators.options.baseorigin.md create mode 100644 apps/docs/api/starter-kitty-validators.options.md create mode 100644 apps/docs/api/starter-kitty-validators.options.whitelist.md create mode 100644 apps/docs/api/starter-kitty-validators.optionserror._constructor_.md create mode 100644 apps/docs/api/starter-kitty-validators.optionserror.md create mode 100644 apps/docs/api/starter-kitty-validators.urlvalidationerror._constructor_.md create mode 100644 apps/docs/api/starter-kitty-validators.urlvalidationerror.md create mode 100644 apps/docs/api/starter-kitty-validators.urlvalidator._constructor_.md create mode 100644 apps/docs/api/starter-kitty-validators.urlvalidator.md create mode 100644 apps/docs/api/starter-kitty-validators.urlvalidator.parse.md create mode 100644 apps/docs/index.md create mode 100644 apps/docs/package.json create mode 100644 etc/starter-kitty-validators.api.md create mode 100644 packages/validators/api-extractor.json create mode 100644 packages/validators/temp/starter-kitty-validators.api.json create mode 100644 packages/validators/temp/starter-kitty-validators.api.md diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..6f364e3 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,50 @@ +name: Documentation + +on: + push: + branches: [develop] + +permissions: + id-token: write + pages: write + contents: write + packages: write + +jobs: + publish-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - run: corepack enable + - uses: actions/setup-node@v3 + with: + node-version: lts/* + cache: pnpm + registry-url: "https://registry.npmjs.org/" + scope: "@opengovsg" + + - name: Install Dependencies + run: | + pnpm i --frozen-lockfile + npm install -g @microsoft/api-documenter + npm install -g @microsoft/api-extractor + + - name: Check API report + run: pnpm ci:report + + - name: Generate documentation + run: pnpm build:docs + + - name: Upload to GitHub Pages + uses: actions/upload-pages-artifact@v3 + with: + path: apps/docs/.vitepress/dist + + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index afe9ded..650b079 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -27,4 +27,4 @@ jobs: run: pnpm install - name: Lint 🛀 - run: pnpm -r run lint + run: pnpm lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index feab48b..9d8c20d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: release +name: Release on: push: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e7f12df..868971a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,8 +26,7 @@ jobs: run: pnpm install - name: Run tests - run: | - pnpm -r run test + run: pnpm test build: runs-on: ubuntu-latest @@ -48,4 +47,4 @@ jobs: - name: Compile run: | - pnpm -r run build + pnpm build diff --git a/.gitignore b/.gitignore index 442b99e..5578ef6 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ coverage out/ build dist +cache # Debug diff --git a/api-extractor.json b/api-extractor.json new file mode 100644 index 0000000..1f16c4a --- /dev/null +++ b/api-extractor.json @@ -0,0 +1,434 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/lib/index.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we might specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + * + * The "bundledPackages" elements may specify glob patterns using minimatch syntax. To ensure deterministic + * output, globs are expanded by matching explicitly declared top-level dependencies only. For example, + * the pattern below will NOT match "@my-company/example" unless it appears in a field such as "dependencies" + * or "devDependencies" of the project's package.json file: + * + * "bundledPackages": [ "@my-company/*" ], + */ + "bundledPackages": [], + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Set to true when invoking API Extractor's test harness. When `testMode` is true, the `toolVersion` field in the + * .api.json file is assigned an empty string to prevent spurious diffs in output files tracked for tests. + * + * DEFAULT VALUE: "false" + */ + // "testMode": false, + + /** + * Specifies how API Extractor sorts members of an enum when generating the .api.json file. By default, the output + * files will be sorted alphabetically, which is "by-name". To keep the ordering in the source code, specify + * "preserve". + * + * DEFAULT VALUE: "by-name" + */ + // "enumMemberOrder": "by-name", + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + "reportFolder": "./etc/" + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/", + + /** + * Whether "forgotten exports" should be included in the API report file. Forgotten exports are declarations + * flagged with `ae-forgotten-export` warnings. See https://api-extractor.com/pages/messages/ae-forgotten-export/ to + * learn more. + * + * DEFAULT VALUE: "false" + */ + // "includeForgottenExports": false + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json", + + /** + * Whether "forgotten exports" should be included in the doc model file. Forgotten exports are declarations + * flagged with `ae-forgotten-export` warnings. See https://api-extractor.com/pages/messages/ae-forgotten-export/ to + * learn more. + * + * DEFAULT VALUE: "false" + */ + // "includeForgottenExports": false, + + /** + * The base URL where the project's source code can be viewed on a website such as GitHub or + * Azure DevOps. This URL path corresponds to the `` path on disk. + * + * This URL is concatenated with the file paths serialized to the doc model to produce URL file paths to individual API items. + * For example, if the `projectFolderUrl` is "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor" and an API + * item's file path is "api/ExtractorConfig.ts", the full URL file path would be + * "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor/api/ExtractorConfig.js". + * + * Can be omitted if you don't need source code links in your API documentation reference. + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "projectFolderUrl": "http://github.com/path/to/your/projectFolder" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": true + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for an "alpha" release. + * This file will include only declarations that are marked as "@public", "@beta", or "@alpha". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "alphaTrimmedFilePath": "/dist/-alpha.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning" + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + } + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + } + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } +} diff --git a/apps/docs/.vitepress/config.mts b/apps/docs/.vitepress/config.mts new file mode 100644 index 0000000..dc6d63e --- /dev/null +++ b/apps/docs/.vitepress/config.mts @@ -0,0 +1,23 @@ +import { defineConfig } from "vitepress"; + +export default defineConfig({ + lang: "en-US", + title: "Starter Kitty", + description: "Common app components that are safe-by-default.", + markdown: { attrs: { disable: true } }, + themeConfig: { + search: { + provider: "local", + }, + + // https://vitepress.dev/reference/default-theme-config + nav: [ + { text: "Home", link: "/" }, + { text: "API", link: "/api" }, + ], + + socialLinks: [ + { icon: "github", link: "https://github.com/opengovsg/starter-kitty" }, + ], + }, +}); diff --git a/apps/docs/api/index.md b/apps/docs/api/index.md new file mode 100644 index 0000000..e6216ea --- /dev/null +++ b/apps/docs/api/index.md @@ -0,0 +1,31 @@ + + +[Home](./index.md) + +## API Reference + +## Packages + + + +
+ +Package + + + + +Description + + +
+ +[@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) + + + + +A set of validators that provide sensible defaults to prevent common security vulnerabilities. + + +
diff --git a/apps/docs/api/starter-kitty-validators.md b/apps/docs/api/starter-kitty-validators.md new file mode 100644 index 0000000..f8100d3 --- /dev/null +++ b/apps/docs/api/starter-kitty-validators.md @@ -0,0 +1,81 @@ + + +[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) + +## starter-kitty-validators package + +A set of validators that provide sensible defaults to prevent common security vulnerabilities. + +## Classes + + + + + +
+ +Class + + + + +Description + + +
+ +[OptionsError](./starter-kitty-validators.optionserror.md) + + + + +Invalid options error. + + +
+ +[UrlValidationError](./starter-kitty-validators.urlvalidationerror.md) + + + + +Invalid URL error. + + +
+ +[UrlValidator](./starter-kitty-validators.urlvalidator.md) + + + + +Validates URLs against a whitelist of allowed protocols and hostnames, preventing open redirects, XSS, SSRF, and other security vulnerabilities. + + +
+ +## Interfaces + + + +
+ +Interface + + + + +Description + + +
+ +[Options](./starter-kitty-validators.options.md) + + + + +The options to use for URL validation. + + +
diff --git a/apps/docs/api/starter-kitty-validators.options.baseorigin.md b/apps/docs/api/starter-kitty-validators.options.baseorigin.md new file mode 100644 index 0000000..5a4fa93 --- /dev/null +++ b/apps/docs/api/starter-kitty-validators.options.baseorigin.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [Options](./starter-kitty-validators.options.md) > [baseOrigin](./starter-kitty-validators.options.baseorigin.md) + +## Options.baseOrigin property + +The base origin to use for relative URLs. If no base origin is provided, relative URLs will be considered invalid. An origin does not include the path or query parameters. For example, a valid base origin is `https://example.com` or `http://localhost:3000`. + +**Signature:** + +```typescript +baseOrigin?: string; +``` diff --git a/apps/docs/api/starter-kitty-validators.options.md b/apps/docs/api/starter-kitty-validators.options.md new file mode 100644 index 0000000..9313be6 --- /dev/null +++ b/apps/docs/api/starter-kitty-validators.options.md @@ -0,0 +1,76 @@ + + +[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [Options](./starter-kitty-validators.options.md) + +## Options interface + +The options to use for URL validation. + +**Signature:** + +```typescript +export interface Options +``` + +## Properties + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[baseOrigin?](./starter-kitty-validators.options.baseorigin.md) + + + + + + + +string + + + + +_(Optional)_ The base origin to use for relative URLs. If no base origin is provided, relative URLs will be considered invalid. An origin does not include the path or query parameters. For example, a valid base origin is `https://example.com` or `http://localhost:3000`. + + +
+ +[whitelist?](./starter-kitty-validators.options.whitelist.md) + + + + + + + +Whitelist + + + + +_(Optional)_ The list of allowed protocols and hostnames for URL validation. + + +
diff --git a/apps/docs/api/starter-kitty-validators.options.whitelist.md b/apps/docs/api/starter-kitty-validators.options.whitelist.md new file mode 100644 index 0000000..c4263bc --- /dev/null +++ b/apps/docs/api/starter-kitty-validators.options.whitelist.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [Options](./starter-kitty-validators.options.md) > [whitelist](./starter-kitty-validators.options.whitelist.md) + +## Options.whitelist property + +The list of allowed protocols and hostnames for URL validation. + +**Signature:** + +```typescript +whitelist?: Whitelist; +``` + +## Example + + +``` +{ + protocols: ['http', 'https'], + hosts: ['example.com'] +} +``` + diff --git a/apps/docs/api/starter-kitty-validators.optionserror._constructor_.md b/apps/docs/api/starter-kitty-validators.optionserror._constructor_.md new file mode 100644 index 0000000..8f66c96 --- /dev/null +++ b/apps/docs/api/starter-kitty-validators.optionserror._constructor_.md @@ -0,0 +1,47 @@ + + +[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [OptionsError](./starter-kitty-validators.optionserror.md) > [(constructor)](./starter-kitty-validators.optionserror._constructor_.md) + +## OptionsError.(constructor) + +Constructs a new instance of the `OptionsError` class + +**Signature:** + +```typescript +constructor(message: string); +``` + +## Parameters + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +message + + + + +string + + + + + +
diff --git a/apps/docs/api/starter-kitty-validators.optionserror.md b/apps/docs/api/starter-kitty-validators.optionserror.md new file mode 100644 index 0000000..d39f31d --- /dev/null +++ b/apps/docs/api/starter-kitty-validators.optionserror.md @@ -0,0 +1,48 @@ + + +[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [OptionsError](./starter-kitty-validators.optionserror.md) + +## OptionsError class + +Invalid options error. + +**Signature:** + +```typescript +export declare class OptionsError extends Error +``` +**Extends:** Error + +## Constructors + + + +
+ +Constructor + + + + +Modifiers + + + + +Description + + +
+ +[(constructor)(message)](./starter-kitty-validators.optionserror._constructor_.md) + + + + + + + +Constructs a new instance of the `OptionsError` class + + +
diff --git a/apps/docs/api/starter-kitty-validators.urlvalidationerror._constructor_.md b/apps/docs/api/starter-kitty-validators.urlvalidationerror._constructor_.md new file mode 100644 index 0000000..ab28cc0 --- /dev/null +++ b/apps/docs/api/starter-kitty-validators.urlvalidationerror._constructor_.md @@ -0,0 +1,47 @@ + + +[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [UrlValidationError](./starter-kitty-validators.urlvalidationerror.md) > [(constructor)](./starter-kitty-validators.urlvalidationerror._constructor_.md) + +## UrlValidationError.(constructor) + +Constructs a new instance of the `UrlValidationError` class + +**Signature:** + +```typescript +constructor(message: string); +``` + +## Parameters + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +message + + + + +string + + + + + +
diff --git a/apps/docs/api/starter-kitty-validators.urlvalidationerror.md b/apps/docs/api/starter-kitty-validators.urlvalidationerror.md new file mode 100644 index 0000000..cc776c3 --- /dev/null +++ b/apps/docs/api/starter-kitty-validators.urlvalidationerror.md @@ -0,0 +1,48 @@ + + +[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [UrlValidationError](./starter-kitty-validators.urlvalidationerror.md) + +## UrlValidationError class + +Invalid URL error. + +**Signature:** + +```typescript +export declare class UrlValidationError extends Error +``` +**Extends:** Error + +## Constructors + + + +
+ +Constructor + + + + +Modifiers + + + + +Description + + +
+ +[(constructor)(message)](./starter-kitty-validators.urlvalidationerror._constructor_.md) + + + + + + + +Constructs a new instance of the `UrlValidationError` class + + +
diff --git a/apps/docs/api/starter-kitty-validators.urlvalidator._constructor_.md b/apps/docs/api/starter-kitty-validators.urlvalidator._constructor_.md new file mode 100644 index 0000000..d5ec783 --- /dev/null +++ b/apps/docs/api/starter-kitty-validators.urlvalidator._constructor_.md @@ -0,0 +1,62 @@ + + +[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [UrlValidator](./starter-kitty-validators.urlvalidator.md) > [(constructor)](./starter-kitty-validators.urlvalidator._constructor_.md) + +## UrlValidator.(constructor) + +Creates a new UrlValidator instance. If no options are provided, the validator will use the default options: + +```ts +{ + whitelist: { + protocols: ['http', 'https'], + }, +} +``` + +**Signature:** + +```typescript +constructor(options?: Options); +``` + +## Parameters + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +options + + + + +[Options](./starter-kitty-validators.options.md) + + + + +_(Optional)_ The options to use for validation + + +
+ +## Exceptions + +[OptionsError](./starter-kitty-validators.optionserror.md) If the options are invalid + diff --git a/apps/docs/api/starter-kitty-validators.urlvalidator.md b/apps/docs/api/starter-kitty-validators.urlvalidator.md new file mode 100644 index 0000000..427ffb2 --- /dev/null +++ b/apps/docs/api/starter-kitty-validators.urlvalidator.md @@ -0,0 +1,89 @@ + + +[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [UrlValidator](./starter-kitty-validators.urlvalidator.md) + +## UrlValidator class + +Validates URLs against a whitelist of allowed protocols and hostnames, preventing open redirects, XSS, SSRF, and other security vulnerabilities. + +**Signature:** + +```typescript +export declare class UrlValidator +``` + +## Constructors + + + +
+ +Constructor + + + + +Modifiers + + + + +Description + + +
+ +[(constructor)(options)](./starter-kitty-validators.urlvalidator._constructor_.md) + + + + + + + +Creates a new UrlValidator instance. If no options are provided, the validator will use the default options: + +```ts +{ + whitelist: { + protocols: ['http', 'https'], + }, +} +``` + + +
+ +## Methods + + + +
+ +Method + + + + +Modifiers + + + + +Description + + +
+ +[parse(url)](./starter-kitty-validators.urlvalidator.parse.md) + + + + + + + +Parses a URL string. + + +
diff --git a/apps/docs/api/starter-kitty-validators.urlvalidator.parse.md b/apps/docs/api/starter-kitty-validators.urlvalidator.parse.md new file mode 100644 index 0000000..e277a22 --- /dev/null +++ b/apps/docs/api/starter-kitty-validators.urlvalidator.parse.md @@ -0,0 +1,59 @@ + + +[Home](./index.md) > [@opengovsg/starter-kitty-validators](./starter-kitty-validators.md) > [UrlValidator](./starter-kitty-validators.urlvalidator.md) > [parse](./starter-kitty-validators.urlvalidator.parse.md) + +## UrlValidator.parse() method + +Parses a URL string. + +**Signature:** + +```typescript +parse(url: string): URL; +``` + +## Parameters + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +url + + + + +string + + + + +The URL to validate + + +
+**Returns:** + +URL + +The URL object if the URL is valid + +## Exceptions + +[UrlValidationError](./starter-kitty-validators.urlvalidationerror.md) If the URL is invalid + diff --git a/apps/docs/index.md b/apps/docs/index.md new file mode 100644 index 0000000..4622c3c --- /dev/null +++ b/apps/docs/index.md @@ -0,0 +1,3 @@ +# @opengovsg/starter-kitty + +Common app components that are safe-by-default. diff --git a/apps/docs/package.json b/apps/docs/package.json new file mode 100644 index 0000000..1f47de2 --- /dev/null +++ b/apps/docs/package.json @@ -0,0 +1,19 @@ +{ + "name": "@opengovsg/starter-kitty-docs", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "dev": "vitepress dev", + "build:docs": "vitepress build", + "preview": "vitepress preview" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "vitepress": "^1.3.1", + "vue": "~3.4.31", + "@opengovsg/starter-kitty-validators": "workspace:*" + } +} diff --git a/etc/starter-kitty-validators.api.md b/etc/starter-kitty-validators.api.md new file mode 100644 index 0000000..cd35afd --- /dev/null +++ b/etc/starter-kitty-validators.api.md @@ -0,0 +1,34 @@ +## API Report File for "@opengovsg/starter-kitty-validators" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +/// + +import { z } from 'zod'; + +// @public +export interface Options { + baseOrigin?: string; + // Warning: (ae-forgotten-export) The symbol "Whitelist" needs to be exported by the entry point index.d.ts + whitelist?: Whitelist; +} + +// @public +export class OptionsError extends Error { + constructor(message: string); +} + +// @public +export class UrlValidationError extends Error { + constructor(message: string); +} + +// @public +export class UrlValidator { + constructor(options?: Options); + parse(url: string): URL; +} + +``` diff --git a/package.json b/package.json index 24eef9c..44528d8 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,14 @@ "name": "starter-kitty", "private": true, "scripts": { + "preinstall": "npx only-allow pnpm", "build": "turbo build", + "build:report": "turbo build:report", + "build:docs": "turbo build:docs", "dev": "turbo dev", "lint": "turbo lint", + "test": "turbo test", + "ci:report": "turbo ci:report", "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "devDependencies": { diff --git a/packages/validators/api-extractor.json b/packages/validators/api-extractor.json new file mode 100644 index 0000000..549515e --- /dev/null +++ b/packages/validators/api-extractor.json @@ -0,0 +1,21 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + "extends": "../../api-extractor.json", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/dist/index.d.ts" +} diff --git a/packages/validators/package.json b/packages/validators/package.json index af112e4..f08c610 100644 --- a/packages/validators/package.json +++ b/packages/validators/package.json @@ -7,19 +7,22 @@ "dist" ], "scripts": { - "build": "tsup ./src/index.ts --clean --dts --target es2020", + "build": "tsc && tsc-alias", + "build:report": "api-extractor run --local --verbose", + "build:docs": "api-documenter markdown --input-folder ./temp/ --output-folder ../../apps/docs/api/", "lint": "eslint \"**/*.{js,jsx,ts,tsx}\" --cache", - "test": "vitest" + "test": "vitest", + "ci:report": "api-extractor run --verbose" }, "dependencies": { "zod": "^3.23.8", "zod-validation-error": "^3.3.0" }, "devDependencies": { + "@swc/core": "^1.6.13", "@types/node": "^18", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.0.0", - "@swc/core": "^1.6.13", "eslint": "^8.56.0", "eslint-config-opengovsg": "^3.0.0", "eslint-config-prettier": "^8.6.0", @@ -28,6 +31,7 @@ "eslint-plugin-simple-import-sort": "^10.0.0", "eslint-plugin-tsdoc": "^0.3.0", "prettier": "^2.8.4", + "tsc-alias": "^1.8.10", "tsup": "^8.1.0", "typescript": "^5.4.5", "vitest": "^2.0.2" diff --git a/packages/validators/src/__tests__/url.test.ts b/packages/validators/src/__tests__/url.test.ts index 62a59e1..8551ac3 100644 --- a/packages/validators/src/__tests__/url.test.ts +++ b/packages/validators/src/__tests__/url.test.ts @@ -75,6 +75,7 @@ describe('UrlValidator with custom protocol whitelist', () => { describe('UrlValidator with custom host whitelist', () => { const validator = new UrlValidator({ whitelist: { + protocols: ['http', 'https'], hosts: ['example.com'], }, }) @@ -96,7 +97,7 @@ describe('UrlValidator with base URL', () => { }) it('should parse a valid relative URL', () => { - const url = validator.parse('/path', 'https://example.com') + const url = validator.parse('/path') expect(url).toBeInstanceOf(URL) expect(url.href).toBe('https://example.com/path') }) diff --git a/packages/validators/src/index.ts b/packages/validators/src/index.ts index 03be2c5..1356977 100644 --- a/packages/validators/src/index.ts +++ b/packages/validators/src/index.ts @@ -1 +1,9 @@ +/** + * A set of validators that provide sensible defaults to prevent common security vulnerabilities. + * + * @packageDocumentation + */ + export * from '@/url' +export type * from '@/url/errors' +export type { Options } from '@/url/options' diff --git a/packages/validators/src/url/errors.ts b/packages/validators/src/url/errors.ts index 694c169..4c3b59f 100644 --- a/packages/validators/src/url/errors.ts +++ b/packages/validators/src/url/errors.ts @@ -1,3 +1,8 @@ +/** + * Invalid options error. + * + * @public + */ export class OptionsError extends Error { constructor(message: string) { super(message) @@ -5,6 +10,11 @@ export class OptionsError extends Error { } } +/** + * Invalid URL error. + * + * @public + */ export class UrlValidationError extends Error { constructor(message: string) { super(message) diff --git a/packages/validators/src/url/index.ts b/packages/validators/src/url/index.ts index afc5bbb..34a542e 100644 --- a/packages/validators/src/url/index.ts +++ b/packages/validators/src/url/index.ts @@ -2,20 +2,13 @@ import { ZodError } from 'zod' import { fromError } from 'zod-validation-error' import { OptionsError, UrlValidationError } from '@/url/errors' -import { defaultOptions, optionsSchema, Whitelist } from '@/url/options' +import { defaultOptions, Options, optionsSchema } from '@/url/options' import { createUrlSchema } from '@/url/schema' -interface Options { - /** - * The base origin to use for relative URLs. If no base origin is provided, relative URLs will be considered invalid. - * An origin does not include the path or query parameters. For example, a valid base origin is https://example.com or http://localhost:3000. - */ - baseOrigin?: string - whitelist: Whitelist -} - /** * Validates URLs against a whitelist of allowed protocols and hostnames, preventing open redirects, XSS, SSRF, and other security vulnerabilities. + * + * @public */ export class UrlValidator { private schema @@ -49,8 +42,8 @@ export class UrlValidator { * Parses a URL string. * * @param url - The URL to validate - * @returns The URL object if the URL is valid * @throws {@link UrlValidationError} If the URL is invalid + * @returns The URL object if the URL is valid * * @public */ diff --git a/packages/validators/src/url/options.ts b/packages/validators/src/url/options.ts index bb3ed8f..58d0ea3 100644 --- a/packages/validators/src/url/options.ts +++ b/packages/validators/src/url/options.ts @@ -21,6 +21,36 @@ export const whitelistSchema = z.object({ hosts: z.array(z.string()).optional(), }) +/** + * The options to use for URL validation. + * + * @public + */ +export interface Options { + /** + * The base origin to use for relative URLs. If no base origin is provided, relative URLs will be considered invalid. + * An origin does not include the path or query parameters. For example, a valid base origin is `https://example.com` or `http://localhost:3000`. + */ + baseOrigin?: string + /** + * The list of allowed protocols and hostnames for URL validation. + * + * @example + * ``` + * { + * protocols: ['http', 'https'], + * hosts: ['example.com'] + * } + * ``` + * */ + whitelist?: Whitelist +} + +/** + * The list of allowed protocols and hostnames for URL validation. + * + * @public + */ export type Whitelist = z.infer export const optionsSchema = z.object({ diff --git a/packages/validators/src/url/utils.ts b/packages/validators/src/url/utils.ts index 4ba1ea1..3e48694 100644 --- a/packages/validators/src/url/utils.ts +++ b/packages/validators/src/url/utils.ts @@ -11,7 +11,7 @@ export const resolveRelativeUrl = (url: string, baseOrigin?: URL): URL => { return new URL(url) } - if (!URL.canParse(url, baseOrigin)) { + if (!URL.canParse(url, baseOrigin.href)) { throw new UrlValidationError(`Invalid URL: ${url}`) } const normalizedUrl = new URL(url, baseOrigin) diff --git a/packages/validators/temp/starter-kitty-validators.api.json b/packages/validators/temp/starter-kitty-validators.api.json new file mode 100644 index 0000000..7a67e92 --- /dev/null +++ b/packages/validators/temp/starter-kitty-validators.api.json @@ -0,0 +1,480 @@ +{ + "metadata": { + "toolPackage": "@microsoft/api-extractor", + "toolVersion": "7.47.2", + "schemaVersion": 1011, + "oldestForwardsCompatibleVersion": 1001, + "tsdocConfig": { + "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", + "noStandardTags": true, + "tagDefinitions": [ + { + "tagName": "@alpha", + "syntaxKind": "modifier" + }, + { + "tagName": "@beta", + "syntaxKind": "modifier" + }, + { + "tagName": "@defaultValue", + "syntaxKind": "block" + }, + { + "tagName": "@decorator", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@deprecated", + "syntaxKind": "block" + }, + { + "tagName": "@eventProperty", + "syntaxKind": "modifier" + }, + { + "tagName": "@example", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@experimental", + "syntaxKind": "modifier" + }, + { + "tagName": "@inheritDoc", + "syntaxKind": "inline" + }, + { + "tagName": "@internal", + "syntaxKind": "modifier" + }, + { + "tagName": "@label", + "syntaxKind": "inline" + }, + { + "tagName": "@link", + "syntaxKind": "inline", + "allowMultiple": true + }, + { + "tagName": "@override", + "syntaxKind": "modifier" + }, + { + "tagName": "@packageDocumentation", + "syntaxKind": "modifier" + }, + { + "tagName": "@param", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@privateRemarks", + "syntaxKind": "block" + }, + { + "tagName": "@public", + "syntaxKind": "modifier" + }, + { + "tagName": "@readonly", + "syntaxKind": "modifier" + }, + { + "tagName": "@remarks", + "syntaxKind": "block" + }, + { + "tagName": "@returns", + "syntaxKind": "block" + }, + { + "tagName": "@sealed", + "syntaxKind": "modifier" + }, + { + "tagName": "@see", + "syntaxKind": "block" + }, + { + "tagName": "@throws", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@typeParam", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@virtual", + "syntaxKind": "modifier" + }, + { + "tagName": "@betaDocumentation", + "syntaxKind": "modifier" + }, + { + "tagName": "@internalRemarks", + "syntaxKind": "block" + }, + { + "tagName": "@preapproved", + "syntaxKind": "modifier" + } + ], + "supportForTags": { + "@alpha": true, + "@beta": true, + "@defaultValue": true, + "@decorator": true, + "@deprecated": true, + "@eventProperty": true, + "@example": true, + "@experimental": true, + "@inheritDoc": true, + "@internal": true, + "@label": true, + "@link": true, + "@override": true, + "@packageDocumentation": true, + "@param": true, + "@privateRemarks": true, + "@public": true, + "@readonly": true, + "@remarks": true, + "@returns": true, + "@sealed": true, + "@see": true, + "@throws": true, + "@typeParam": true, + "@virtual": true, + "@betaDocumentation": true, + "@internalRemarks": true, + "@preapproved": true + }, + "reportUnsupportedHtmlElements": false + } + }, + "kind": "Package", + "canonicalReference": "@opengovsg/starter-kitty-validators!", + "docComment": "/**\n * A set of validators that provide sensible defaults to prevent common security vulnerabilities.\n *\n * @packageDocumentation\n */\n", + "name": "@opengovsg/starter-kitty-validators", + "preserveMemberOrder": false, + "members": [ + { + "kind": "EntryPoint", + "canonicalReference": "@opengovsg/starter-kitty-validators!", + "name": "", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Interface", + "canonicalReference": "@opengovsg/starter-kitty-validators!Options:interface", + "docComment": "/**\n * The options to use for URL validation.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export interface Options " + } + ], + "fileUrlPath": "dist/url/options.d.ts", + "releaseTag": "Public", + "name": "Options", + "preserveMemberOrder": false, + "members": [ + { + "kind": "PropertySignature", + "canonicalReference": "@opengovsg/starter-kitty-validators!Options#baseOrigin:member", + "docComment": "/**\n * The base origin to use for relative URLs. If no base origin is provided, relative URLs will be considered invalid. An origin does not include the path or query parameters. For example, a valid base origin is `https://example.com` or `http://localhost:3000`.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "baseOrigin?: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": false, + "isOptional": true, + "releaseTag": "Public", + "name": "baseOrigin", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "PropertySignature", + "canonicalReference": "@opengovsg/starter-kitty-validators!Options#whitelist:member", + "docComment": "/**\n * The list of allowed protocols and hostnames for URL validation.\n *\n * @example\n * ```\n * {\n * protocols: ['http', 'https'],\n * hosts: ['example.com']\n * }\n * ```\n *\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "whitelist?: " + }, + { + "kind": "Reference", + "text": "Whitelist", + "canonicalReference": "@opengovsg/starter-kitty-validators!~Whitelist:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": false, + "isOptional": true, + "releaseTag": "Public", + "name": "whitelist", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + } + ], + "extendsTokenRanges": [] + }, + { + "kind": "Class", + "canonicalReference": "@opengovsg/starter-kitty-validators!OptionsError:class", + "docComment": "/**\n * Invalid options error.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class OptionsError extends " + }, + { + "kind": "Reference", + "text": "Error", + "canonicalReference": "!Error:interface" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "dist/url/errors.d.ts", + "releaseTag": "Public", + "isAbstract": false, + "name": "OptionsError", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@opengovsg/starter-kitty-validators!OptionsError:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `OptionsError` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(message: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "message", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ] + } + ], + "extendsTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Class", + "canonicalReference": "@opengovsg/starter-kitty-validators!UrlValidationError:class", + "docComment": "/**\n * Invalid URL error.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class UrlValidationError extends " + }, + { + "kind": "Reference", + "text": "Error", + "canonicalReference": "!Error:interface" + }, + { + "kind": "Content", + "text": " " + } + ], + "fileUrlPath": "dist/url/errors.d.ts", + "releaseTag": "Public", + "isAbstract": false, + "name": "UrlValidationError", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@opengovsg/starter-kitty-validators!UrlValidationError:constructor(1)", + "docComment": "/**\n * Constructs a new instance of the `UrlValidationError` class\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(message: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "message", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ] + } + ], + "extendsTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "implementsTokenRanges": [] + }, + { + "kind": "Class", + "canonicalReference": "@opengovsg/starter-kitty-validators!UrlValidator:class", + "docComment": "/**\n * Validates URLs against a whitelist of allowed protocols and hostnames, preventing open redirects, XSS, SSRF, and other security vulnerabilities.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare class UrlValidator " + } + ], + "fileUrlPath": "dist/url/index.d.ts", + "releaseTag": "Public", + "isAbstract": false, + "name": "UrlValidator", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Constructor", + "canonicalReference": "@opengovsg/starter-kitty-validators!UrlValidator:constructor(1)", + "docComment": "/**\n * Creates a new UrlValidator instance. If no options are provided, the validator will use the default options:\n * ```ts\n * {\n * whitelist: {\n * protocols: ['http', 'https'],\n * },\n * }\n * ```\n *\n * @param options - The options to use for validation\n *\n * @throws\n *\n * {@link OptionsError} If the options are invalid\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "constructor(options?: " + }, + { + "kind": "Reference", + "text": "Options", + "canonicalReference": "@opengovsg/starter-kitty-validators!Options:interface" + }, + { + "kind": "Content", + "text": ");" + } + ], + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "options", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": true + } + ] + }, + { + "kind": "Method", + "canonicalReference": "@opengovsg/starter-kitty-validators!UrlValidator#parse:member(1)", + "docComment": "/**\n * Parses a URL string.\n *\n * @param url - The URL to validate\n *\n * @returns The URL object if the URL is valid\n *\n * @throws\n *\n * {@link UrlValidationError} If the URL is invalid\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "parse(url: " + }, + { + "kind": "Content", + "text": "string" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "URL", + "canonicalReference": "!\"\\\"url\\\"\".__global.URL:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "url", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "isOptional": false, + "isAbstract": false, + "name": "parse" + } + ], + "implementsTokenRanges": [] + } + ] + } + ] +} diff --git a/packages/validators/temp/starter-kitty-validators.api.md b/packages/validators/temp/starter-kitty-validators.api.md new file mode 100644 index 0000000..cd35afd --- /dev/null +++ b/packages/validators/temp/starter-kitty-validators.api.md @@ -0,0 +1,34 @@ +## API Report File for "@opengovsg/starter-kitty-validators" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +/// + +import { z } from 'zod'; + +// @public +export interface Options { + baseOrigin?: string; + // Warning: (ae-forgotten-export) The symbol "Whitelist" needs to be exported by the entry point index.d.ts + whitelist?: Whitelist; +} + +// @public +export class OptionsError extends Error { + constructor(message: string); +} + +// @public +export class UrlValidationError extends Error { + constructor(message: string); +} + +// @public +export class UrlValidator { + constructor(options?: Options); + parse(url: string): URL; +} + +``` diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fa8c378..eda49ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,18 @@ importers: specifier: ^5.4.5 version: 5.4.5 + apps/docs: + devDependencies: + '@opengovsg/starter-kitty-validators': + specifier: workspace:* + version: link:../../packages/validators + vitepress: + specifier: ^1.3.1 + version: 1.3.1(@algolia/client-search@4.24.0)(@types/node@18.19.39)(postcss@8.4.39)(search-insights@2.15.0)(typescript@5.4.5) + vue: + specifier: ~3.4.31 + version: 3.4.33(typescript@5.4.5) + packages/validators: dependencies: zod: @@ -63,6 +75,9 @@ importers: prettier: specifier: ^2.8.4 version: 2.8.8 + tsc-alias: + specifier: ^1.8.10 + version: 1.8.10 tsup: specifier: ^8.1.0 version: 8.1.0(@swc/core@1.6.13)(postcss@8.4.39)(ts-node@10.9.1(@swc/core@1.6.13)(@types/node@18.19.39)(typescript@5.4.5))(typescript@5.4.5) @@ -79,14 +94,119 @@ packages: resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} engines: {node: '>=0.10.0'} + '@algolia/autocomplete-core@1.9.3': + resolution: {integrity: sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==} + + '@algolia/autocomplete-plugin-algolia-insights@1.9.3': + resolution: {integrity: sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==} + peerDependencies: + search-insights: '>= 1 < 3' + + '@algolia/autocomplete-preset-algolia@1.9.3': + resolution: {integrity: sha512-d4qlt6YmrLMYy95n5TB52wtNDr6EgAIPH81dvvvW8UmuWRgxEtY0NJiPwl/h95JtG2vmRM804M0DSwMCNZlzRA==} + peerDependencies: + '@algolia/client-search': '>= 4.9.1 < 6' + algoliasearch: '>= 4.9.1 < 6' + + '@algolia/autocomplete-shared@1.9.3': + resolution: {integrity: sha512-Wnm9E4Ye6Rl6sTTqjoymD+l8DjSTHsHboVRYrKgEt8Q7UHm9nYbqhN/i0fhUYA3OAEH7WA8x3jfpnmJm3rKvaQ==} + peerDependencies: + '@algolia/client-search': '>= 4.9.1 < 6' + algoliasearch: '>= 4.9.1 < 6' + + '@algolia/cache-browser-local-storage@4.24.0': + resolution: {integrity: sha512-t63W9BnoXVrGy9iYHBgObNXqYXM3tYXCjDSHeNwnsc324r4o5UiVKUiAB4THQ5z9U5hTj6qUvwg/Ez43ZD85ww==} + + '@algolia/cache-common@4.24.0': + resolution: {integrity: sha512-emi+v+DmVLpMGhp0V9q9h5CdkURsNmFC+cOS6uK9ndeJm9J4TiqSvPYVu+THUP8P/S08rxf5x2P+p3CfID0Y4g==} + + '@algolia/cache-in-memory@4.24.0': + resolution: {integrity: sha512-gDrt2so19jW26jY3/MkFg5mEypFIPbPoXsQGQWAi6TrCPsNOSEYepBMPlucqWigsmEy/prp5ug2jy/N3PVG/8w==} + + '@algolia/client-account@4.24.0': + resolution: {integrity: sha512-adcvyJ3KjPZFDybxlqnf+5KgxJtBjwTPTeyG2aOyoJvx0Y8dUQAEOEVOJ/GBxX0WWNbmaSrhDURMhc+QeevDsA==} + + '@algolia/client-analytics@4.24.0': + resolution: {integrity: sha512-y8jOZt1OjwWU4N2qr8G4AxXAzaa8DBvyHTWlHzX/7Me1LX8OayfgHexqrsL4vSBcoMmVw2XnVW9MhL+Y2ZDJXg==} + + '@algolia/client-common@4.24.0': + resolution: {integrity: sha512-bc2ROsNL6w6rqpl5jj/UywlIYC21TwSSoFHKl01lYirGMW+9Eek6r02Tocg4gZ8HAw3iBvu6XQiM3BEbmEMoiA==} + + '@algolia/client-personalization@4.24.0': + resolution: {integrity: sha512-l5FRFm/yngztweU0HdUzz1rC4yoWCFo3IF+dVIVTfEPg906eZg5BOd1k0K6rZx5JzyyoP4LdmOikfkfGsKVE9w==} + + '@algolia/client-search@4.24.0': + resolution: {integrity: sha512-uRW6EpNapmLAD0mW47OXqTP8eiIx5F6qN9/x/7HHO6owL3N1IXqydGwW5nhDFBrV+ldouro2W1VX3XlcUXEFCA==} + + '@algolia/logger-common@4.24.0': + resolution: {integrity: sha512-LLUNjkahj9KtKYrQhFKCzMx0BY3RnNP4FEtO+sBybCjJ73E8jNdaKJ/Dd8A/VA4imVHP5tADZ8pn5B8Ga/wTMA==} + + '@algolia/logger-console@4.24.0': + resolution: {integrity: sha512-X4C8IoHgHfiUROfoRCV+lzSy+LHMgkoEEU1BbKcsfnV0i0S20zyy0NLww9dwVHUWNfPPxdMU+/wKmLGYf96yTg==} + + '@algolia/recommend@4.24.0': + resolution: {integrity: sha512-P9kcgerfVBpfYHDfVZDvvdJv0lEoCvzNlOy2nykyt5bK8TyieYyiD0lguIJdRZZYGre03WIAFf14pgE+V+IBlw==} + + '@algolia/requester-browser-xhr@4.24.0': + resolution: {integrity: sha512-Z2NxZMb6+nVXSjF13YpjYTdvV3032YTBSGm2vnYvYPA6mMxzM3v5rsCiSspndn9rzIW4Qp1lPHBvuoKJV6jnAA==} + + '@algolia/requester-common@4.24.0': + resolution: {integrity: sha512-k3CXJ2OVnvgE3HMwcojpvY6d9kgKMPRxs/kVohrwF5WMr2fnqojnycZkxPoEg+bXm8fi5BBfFmOqgYztRtHsQA==} + + '@algolia/requester-node-http@4.24.0': + resolution: {integrity: sha512-JF18yTjNOVYvU/L3UosRcvbPMGT9B+/GQWNWnenIImglzNVGpyzChkXLnrSf6uxwVNO6ESGu6oN8MqcGQcjQJw==} + + '@algolia/transporter@4.24.0': + resolution: {integrity: sha512-86nI7w6NzWxd1Zp9q3413dRshDqAzSbsQjhcDhPIatEFiZrL1/TjnHL8S7jVKFePlIMzDsZWXAXwXzcok9c5oA==} + '@ampproject/remapping@2.3.0': resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} + '@babel/helper-string-parser@7.24.8': + resolution: {integrity: sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.24.7': + resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.24.8': + resolution: {integrity: sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/types@7.24.9': + resolution: {integrity: sha512-xm8XrMKz0IlUdocVbYJe0Z9xEgidU7msskG8BbhnTPK/HZ2z/7FP7ykqPgrUH+C+r414mNfNWam1f2vqOjqjYQ==} + engines: {node: '>=6.9.0'} + '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} + '@docsearch/css@3.6.1': + resolution: {integrity: sha512-VtVb5DS+0hRIprU2CO6ZQjK2Zg4QU5HrDM1+ix6rT0umsYvFvatMAnf97NHZlVWDaaLlx7GRfR/7FikANiM2Fg==} + + '@docsearch/js@3.6.1': + resolution: {integrity: sha512-erI3RRZurDr1xES5hvYJ3Imp7jtrXj6f1xYIzDzxiS7nNBufYWPbJwrmMqWC5g9y165PmxEmN9pklGCdLi0Iqg==} + + '@docsearch/react@3.6.1': + resolution: {integrity: sha512-qXZkEPvybVhSXj0K7U3bXc233tk5e8PfhoZ6MhPOiik/qUQxYC+Dn9DnoS7CxHQQhHfCvTiN0eY9M12oRghEXw==} + peerDependencies: + '@types/react': '>= 16.8.0 < 19.0.0' + react: '>= 16.8.0 < 19.0.0' + react-dom: '>= 16.8.0 < 19.0.0' + search-insights: '>= 1 < 3' + peerDependenciesMeta: + '@types/react': + optional: true + react: + optional: true + react-dom: + optional: true + search-insights: + optional: true + '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -397,6 +517,12 @@ packages: cpu: [x64] os: [win32] + '@shikijs/core@1.11.0': + resolution: {integrity: sha512-VbEhDAhT/2ozO0TPr5/ZQBO/NWLqtk4ZiBf6NplYpF38mKjNfMMied5fNEfIfYfN+cdKvhDB4VMcKvG/g9c3zg==} + + '@shikijs/transformers@1.11.0': + resolution: {integrity: sha512-RNEUyOxF1cPYVG2EvBv0CZeDU1Tp4fSxmsVD2Ofv+8h9hBqqgpq+l+7uyouyqV1JHNlqwRmUwAqrQU3GQQ3csQ==} + '@swc/core-darwin-arm64@1.6.13': resolution: {integrity: sha512-SOF4buAis72K22BGJ3N8y88mLNfxLNprTuJUpzikyMGrvkuBFNcxYtMhmomO0XHsgLDzOJ+hWzcgjRNzjMsUcQ==} engines: {node: '>=10'} @@ -487,18 +613,36 @@ packages: '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + '@types/hast@3.0.4': + resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/json-schema@7.0.12': resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + '@types/linkify-it@5.0.0': + resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==} + + '@types/markdown-it@14.1.1': + resolution: {integrity: sha512-4NpsnpYl2Gt1ljyBGrKMxFYAYvpqbnnkgP/i/g+NLpjEUa3obn1XJCur9YbEXKDAkaXqsR1LbDnGEJ0MmKFxfg==} + + '@types/mdurl@2.0.0': + resolution: {integrity: sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==} + '@types/node@18.19.39': resolution: {integrity: sha512-nPwTRDKUctxw3di5b4TfT3I0sWDiWoPQCZjXhvdkINntwr8lcoVCKsTgnXeRubKIlfnV+eN/HYk6Jb40tbcEAQ==} '@types/semver@7.5.0': resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} + '@types/unist@3.0.2': + resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==} + + '@types/web-bluetooth@0.0.20': + resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} + '@typescript-eslint/eslint-plugin@6.21.0': resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==} engines: {node: ^16.0.0 || >=18.0.0} @@ -597,6 +741,13 @@ packages: '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@vitejs/plugin-vue@5.0.5': + resolution: {integrity: sha512-LOjm7XeIimLBZyzinBQ6OSm3UBCNVCpLkxGC0oWmm2YPzVZoxMsdvNVimLTBzpAnR9hl/yn1SHGuRfe6/Td9rQ==} + engines: {node: ^18.0.0 || >=20.0.0} + peerDependencies: + vite: ^5.0.0 + vue: ^3.2.25 + '@vitest/expect@2.0.2': resolution: {integrity: sha512-nKAvxBYqcDugYZ4nJvnm5OR8eDJdgWjk4XM9owQKUjzW70q0icGV2HVnQOyYsp906xJaBDUXw0+9EHw2T8e0mQ==} @@ -615,6 +766,94 @@ packages: '@vitest/utils@2.0.2': resolution: {integrity: sha512-pxCY1v7kmOCWYWjzc0zfjGTA3Wmn8PKnlPvSrsA643P1NHl1fOyXj2Q9SaNlrlFE+ivCsxM80Ov3AR82RmHCWQ==} + '@vue/compiler-core@3.4.33': + resolution: {integrity: sha512-MoIREbkdPQlnGfSKDMgzTqzqx5nmEjIc0ydLVYlTACGBsfvOJ4tHSbZXKVF536n6fB+0eZaGEOqsGThPpdvF5A==} + + '@vue/compiler-dom@3.4.33': + resolution: {integrity: sha512-GzB8fxEHKw0gGet5BKlpfXEqoBnzSVWwMnT+dc25wE7pFEfrU/QsvjZMP9rD4iVXHBBoemTct8mN0GJEI6ZX5A==} + + '@vue/compiler-sfc@3.4.33': + resolution: {integrity: sha512-7rk7Vbkn21xMwIUpHQR4hCVejwE6nvhBOiDgoBcR03qvGqRKA7dCBSsHZhwhYUsmjlbJ7OtD5UFIyhP6BY+c8A==} + + '@vue/compiler-ssr@3.4.33': + resolution: {integrity: sha512-0WveC9Ai+eT/1b6LCV5IfsufBZ0HP7pSSTdDjcuW302tTEgoBw8rHVHKPbGUtzGReUFCRXbv6zQDDgucnV2WzQ==} + + '@vue/devtools-api@7.3.6': + resolution: {integrity: sha512-z6cKyxdXrIGgA++eyGBfquj6dCplRdgjt+I18fJx8hjWTXDTIyeQvryyEBMchnfZVyvUTjK3QjGjDpLCnJxPjw==} + + '@vue/devtools-kit@7.3.6': + resolution: {integrity: sha512-5Ym9V3fkJenEoptqKoo+cgY5RTVwrSssFdzRsuyIgaeiskCT+rRJeQdwoo81tyrQ1mfS7Er1rYZlSzr3Y3L/ew==} + + '@vue/devtools-shared@7.3.6': + resolution: {integrity: sha512-R/FOmdJV+hhuwcNoxp6e87RRkEeDMVhWH+nOsnHUrwjjsyeXJ2W1475Ozmw+cbZhejWQzftkHVKO28Fuo1yqCw==} + + '@vue/reactivity@3.4.33': + resolution: {integrity: sha512-B24QIelahDbyHipBgbUItQblbd4w5HpG3KccL+YkGyo3maXyS253FzcTR3pSz739OTphmzlxP7JxEMWBpewilA==} + + '@vue/runtime-core@3.4.33': + resolution: {integrity: sha512-6wavthExzT4iAxpe8q37/rDmf44nyOJGISJPxCi9YsQO+8w9v0gLCFLfH5TzD1V1AYrTAdiF4Y1cgUmP68jP6w==} + + '@vue/runtime-dom@3.4.33': + resolution: {integrity: sha512-iHsMCUSFJ+4z432Bn9kZzHX+zOXa6+iw36DaVRmKYZpPt9jW9riF32SxNwB124i61kp9+AZtheQ/mKoJLerAaQ==} + + '@vue/server-renderer@3.4.33': + resolution: {integrity: sha512-jTH0d6gQcaYideFP/k0WdEu8PpRS9MF8d0b6SfZzNi+ap972pZ0TNIeTaESwdOtdY0XPVj54XEJ6K0wXxir4fw==} + peerDependencies: + vue: 3.4.33 + + '@vue/shared@3.4.33': + resolution: {integrity: sha512-aoRY0jQk3A/cuvdkodTrM4NMfxco8n55eG4H7ML/CRy7OryHfiqvug4xrCBBMbbN+dvXAetDDwZW9DXWWjBntA==} + + '@vueuse/core@10.11.0': + resolution: {integrity: sha512-x3sD4Mkm7PJ+pcq3HX8PLPBadXCAlSDR/waK87dz0gQE+qJnaaFhc/dZVfJz+IUYzTMVGum2QlR7ImiJQN4s6g==} + + '@vueuse/integrations@10.11.0': + resolution: {integrity: sha512-Pp6MtWEIr+NDOccWd8j59Kpjy5YDXogXI61Kb1JxvSfVBO8NzFQkmrKmSZz47i+ZqHnIzxaT38L358yDHTncZg==} + peerDependencies: + async-validator: ^4 + axios: ^1 + change-case: ^4 + drauu: ^0.3 + focus-trap: ^7 + fuse.js: ^6 + idb-keyval: ^6 + jwt-decode: ^3 + nprogress: ^0.2 + qrcode: ^1.5 + sortablejs: ^1 + universal-cookie: ^6 + peerDependenciesMeta: + async-validator: + optional: true + axios: + optional: true + change-case: + optional: true + drauu: + optional: true + focus-trap: + optional: true + fuse.js: + optional: true + idb-keyval: + optional: true + jwt-decode: + optional: true + nprogress: + optional: true + qrcode: + optional: true + sortablejs: + optional: true + universal-cookie: + optional: true + + '@vueuse/metadata@10.11.0': + resolution: {integrity: sha512-kQX7l6l8dVWNqlqyN3ePW3KmjCQO3ZMgXuBMddIu83CmucrsBfXlH+JoviYyRBws/yLTQO8g3Pbw+bdIoVm4oQ==} + + '@vueuse/shared@10.11.0': + resolution: {integrity: sha512-fyNoIXEq3PfX1L3NkNhtVQUSRtqYwJtJg+Bp9rIzculIZWHTkKSysujrOk2J+NrRulLTQH9+3gGSfYLWSEWU1A==} + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -635,6 +874,9 @@ packages: ajv@8.12.0: resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + algoliasearch@4.24.0: + resolution: {integrity: sha512-bf0QV/9jVejssFBmz2HQLxUadxk574t4iwjCKp5E7NBzwKkrDEhKPISIIjAU/p6K5qDx3qoeh4+26zWN1jmw3g==} + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -712,6 +954,9 @@ packages: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} + birpc@0.2.17: + resolution: {integrity: sha512-+hkTxhot+dWsLpp3gia5AkVHIsKlZybNT5gIYiDlNzJrmYPcTM9k5/w2uaj3IPpd7LlEYpmCj4Jj1nC41VhDFg==} + brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -766,9 +1011,17 @@ packages: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} + commander@9.5.0: + resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} + engines: {node: ^12.20.0 || >=14} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + copy-anything@3.0.5: + resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==} + engines: {node: '>=12.13'} + create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} @@ -776,6 +1029,9 @@ packages: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} + csstype@3.1.3: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -846,6 +1102,10 @@ packages: resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==} engines: {node: '>=10.13.0'} + entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + es-abstract@1.22.3: resolution: {integrity: sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==} engines: {node: '>= 0.4'} @@ -1004,6 +1264,9 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} @@ -1057,6 +1320,9 @@ packages: flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + focus-trap@7.5.4: + resolution: {integrity: sha512-N7kHdlgsO/v+iD/dMoJKtsSqs5Dz/dXZVebRgJw23LDk+jMi/974zyiOYDziY2JPp8xivq9BmUGwIJMiuSBi7w==} + for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} @@ -1167,6 +1433,9 @@ packages: resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} engines: {node: '>= 0.4'} + hookable@5.5.3: + resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} + human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} @@ -1304,6 +1573,10 @@ packages: is-weakset@2.0.2: resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==} + is-what@4.1.16: + resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} + engines: {node: '>=12.13'} + isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} @@ -1396,6 +1669,9 @@ packages: make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + mark.js@8.11.1: + resolution: {integrity: sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==} + merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -1429,9 +1705,19 @@ packages: resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} engines: {node: '>=16 || 14 >=14.17'} + minisearch@7.0.2: + resolution: {integrity: sha512-Pf0sFXaCgRpOBDr4G8wTbVAEH9o9rvJzCMwj0TMe3L/NfUuG188xabfx6Vm3vD/Dv5L500n7JeiMB9Mq3sWMfQ==} + + mitt@3.0.1: + resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} + ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + mylas@2.1.13: + resolution: {integrity: sha512-+MrqnJRtxdF+xngFfUUkIMQrUUL0KsxbADUkn23Z/4ibGg192Q+z+CQyiYwvWTsYjJygmMR8+w3ZDa98Zh6ESg==} + engines: {node: '>=12.0.0'} + mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} @@ -1549,6 +1835,9 @@ packages: resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} engines: {node: '>= 14.16'} + perfect-debounce@1.0.0: + resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + picocolors@1.0.1: resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} @@ -1560,6 +1849,10 @@ packages: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} + plimit-lit@1.6.1: + resolution: {integrity: sha512-B7+VDyb8Tl6oMJT9oSO2CW8XC/T4UcJGrwOVoNGwOQsQYhlpfajmrMj5xeejqaASq3V/EqThyOeATEOMuSEXiA==} + engines: {node: '>=12'} + postcss-load-config@4.0.2: resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} engines: {node: '>= 14'} @@ -1576,6 +1869,9 @@ packages: resolution: {integrity: sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==} engines: {node: ^10 || ^12 || >=14} + preact@10.22.1: + resolution: {integrity: sha512-jRYbDDgMpIb5LHq3hkI0bbl+l/TQ9UnkdQ0ww+lp+4MMOdqaUYdFc5qeyP+IV8FAd/2Em7drVPeKdQxsiWCf/A==} + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -1601,6 +1897,10 @@ packages: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} + queue-lit@1.5.2: + resolution: {integrity: sha512-tLc36IOPeMAubu8BkW8YDBV+WyIgKlYU7zUNs0J5Vk9skSZ4JfGlPOqplP0aHdfv7HL0B2Pg6nwiq60Qc6M2Hw==} + engines: {node: '>=12'} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -1646,6 +1946,9 @@ packages: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + rfdc@1.4.1: + resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} deprecated: Rimraf versions prior to v4 are no longer supported @@ -1666,6 +1969,9 @@ packages: safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} + search-insights@2.15.0: + resolution: {integrity: sha512-ch2sPCUDD4sbPQdknVl9ALSi9H7VyoeVbsxznYz6QV55jJ8CI3EtwpO1i84keN4+hF5IeHWIeGvc08530JkVXQ==} + semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -1691,6 +1997,9 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + shiki@1.11.0: + resolution: {integrity: sha512-NqH/O1zRHvnuk/WfSL6b7+DtI7/kkMMSQGlZhm9DyzSU+SoIHhaw/fBZMr+zp9R8KjdIzkk3JKSC6hORuGDyng==} + side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} @@ -1716,6 +2025,10 @@ packages: resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} engines: {node: '>= 8'} + speakingurl@14.0.1: + resolution: {integrity: sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==} + engines: {node: '>=0.10.0'} + stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -1772,6 +2085,10 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true + superjson@2.2.1: + resolution: {integrity: sha512-8iGv75BYOa0xRJHK5vRLEjE2H/i4lulTjzpUXic3Eg8akftYjkmQDa8JARQ42rlczXyFR3IeRoeFCc7RxHsYZA==} + engines: {node: '>=16'} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -1780,6 +2097,9 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + tabbable@6.2.0: + resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} + tapable@2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} engines: {node: '>=6'} @@ -1809,6 +2129,10 @@ packages: resolution: {integrity: sha512-q5nmENpTHgiPVd1cJDDc9cVoYN5x4vCvwT3FMilvKPKneCBZAxn2YWQjDF0UMcE9k0Cay1gBiDfTMU0g+mPMQA==} engines: {node: '>=14.0.0'} + 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'} @@ -1843,6 +2167,10 @@ packages: '@swc/wasm': optional: true + tsc-alias@1.8.10: + resolution: {integrity: sha512-Ibv4KAWfFkFdKJxnWfVtdOmB0Zi1RJVxcbPGiCDsFpCQSsmpWyuzHG3rQyI5YkobWwxFPEyQfu1hdo4qLG2zPw==} + hasBin: true + tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} @@ -1986,6 +2314,18 @@ packages: terser: optional: true + vitepress@1.3.1: + resolution: {integrity: sha512-soZDpg2rRVJNIM/IYMNDPPr+zTHDA5RbLDHAxacRu+Q9iZ2GwSR0QSUlLs+aEZTkG0SOX1dc8RmUYwyuxK8dfQ==} + hasBin: true + peerDependencies: + markdown-it-mathjax3: ^4 + postcss: ^8 + peerDependenciesMeta: + markdown-it-mathjax3: + optional: true + postcss: + optional: true + vitest@2.0.2: resolution: {integrity: sha512-WlpZ9neRIjNBIOQwBYfBSr0+of5ZCbxT2TVGKW4Lv0c8+srCFIiRdsP7U009t8mMn821HQ4XKgkx5dVWpyoyLw==} engines: {node: ^18.0.0 || >=20.0.0} @@ -2011,6 +2351,25 @@ packages: jsdom: optional: true + vue-demi@0.14.8: + resolution: {integrity: sha512-Uuqnk9YE9SsWeReYqK2alDI5YzciATE0r2SkA6iMAtuXvNTMNACJLJEXNXaEy94ECuBe4Sk6RzRU80kjdbIo1Q==} + engines: {node: '>=12'} + hasBin: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + + vue@3.4.33: + resolution: {integrity: sha512-VdMCWQOummbhctl4QFMcW6eNtXHsFyDlX60O/tsSQuCcuDOnJ1qPOhhVla65Niece7xq/P2zyZReIO5mP+LGTQ==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + webidl-conversions@4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} @@ -2078,16 +2437,158 @@ snapshots: '@aashutoshrathi/word-wrap@1.2.6': {} + '@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0)(search-insights@2.15.0)': + dependencies: + '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0)(search-insights@2.15.0) + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0) + transitivePeerDependencies: + - '@algolia/client-search' + - algoliasearch + - search-insights + + '@algolia/autocomplete-plugin-algolia-insights@1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0)(search-insights@2.15.0)': + dependencies: + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0) + search-insights: 2.15.0 + transitivePeerDependencies: + - '@algolia/client-search' + - algoliasearch + + '@algolia/autocomplete-preset-algolia@1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0)': + dependencies: + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0) + '@algolia/client-search': 4.24.0 + algoliasearch: 4.24.0 + + '@algolia/autocomplete-shared@1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0)': + dependencies: + '@algolia/client-search': 4.24.0 + algoliasearch: 4.24.0 + + '@algolia/cache-browser-local-storage@4.24.0': + dependencies: + '@algolia/cache-common': 4.24.0 + + '@algolia/cache-common@4.24.0': {} + + '@algolia/cache-in-memory@4.24.0': + dependencies: + '@algolia/cache-common': 4.24.0 + + '@algolia/client-account@4.24.0': + dependencies: + '@algolia/client-common': 4.24.0 + '@algolia/client-search': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/client-analytics@4.24.0': + dependencies: + '@algolia/client-common': 4.24.0 + '@algolia/client-search': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/client-common@4.24.0': + dependencies: + '@algolia/requester-common': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/client-personalization@4.24.0': + dependencies: + '@algolia/client-common': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/client-search@4.24.0': + dependencies: + '@algolia/client-common': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/logger-common@4.24.0': {} + + '@algolia/logger-console@4.24.0': + dependencies: + '@algolia/logger-common': 4.24.0 + + '@algolia/recommend@4.24.0': + dependencies: + '@algolia/cache-browser-local-storage': 4.24.0 + '@algolia/cache-common': 4.24.0 + '@algolia/cache-in-memory': 4.24.0 + '@algolia/client-common': 4.24.0 + '@algolia/client-search': 4.24.0 + '@algolia/logger-common': 4.24.0 + '@algolia/logger-console': 4.24.0 + '@algolia/requester-browser-xhr': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@algolia/requester-node-http': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/requester-browser-xhr@4.24.0': + dependencies: + '@algolia/requester-common': 4.24.0 + + '@algolia/requester-common@4.24.0': {} + + '@algolia/requester-node-http@4.24.0': + dependencies: + '@algolia/requester-common': 4.24.0 + + '@algolia/transporter@4.24.0': + dependencies: + '@algolia/cache-common': 4.24.0 + '@algolia/logger-common': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@ampproject/remapping@2.3.0': dependencies: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 + '@babel/helper-string-parser@7.24.8': {} + + '@babel/helper-validator-identifier@7.24.7': {} + + '@babel/parser@7.24.8': + dependencies: + '@babel/types': 7.24.9 + + '@babel/types@7.24.9': + dependencies: + '@babel/helper-string-parser': 7.24.8 + '@babel/helper-validator-identifier': 7.24.7 + to-fast-properties: 2.0.0 + '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 optional: true + '@docsearch/css@3.6.1': {} + + '@docsearch/js@3.6.1(@algolia/client-search@4.24.0)(search-insights@2.15.0)': + dependencies: + '@docsearch/react': 3.6.1(@algolia/client-search@4.24.0)(search-insights@2.15.0) + preact: 10.22.1 + transitivePeerDependencies: + - '@algolia/client-search' + - '@types/react' + - react + - react-dom + - search-insights + + '@docsearch/react@3.6.1(@algolia/client-search@4.24.0)(search-insights@2.15.0)': + dependencies: + '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0)(search-insights@2.15.0) + '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0) + '@docsearch/css': 3.6.1 + algoliasearch: 4.24.0 + optionalDependencies: + search-insights: 2.15.0 + transitivePeerDependencies: + - '@algolia/client-search' + '@esbuild/aix-ppc64@0.21.5': optional: true @@ -2320,6 +2821,14 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.18.1': optional: true + '@shikijs/core@1.11.0': + dependencies: + '@types/hast': 3.0.4 + + '@shikijs/transformers@1.11.0': + dependencies: + shiki: 1.11.0 + '@swc/core-darwin-arm64@1.6.13': optional: true @@ -2386,16 +2895,33 @@ snapshots: '@types/estree@1.0.5': {} + '@types/hast@3.0.4': + dependencies: + '@types/unist': 3.0.2 + '@types/json-schema@7.0.12': {} '@types/json5@0.0.29': {} + '@types/linkify-it@5.0.0': {} + + '@types/markdown-it@14.1.1': + dependencies: + '@types/linkify-it': 5.0.0 + '@types/mdurl': 2.0.0 + + '@types/mdurl@2.0.0': {} + '@types/node@18.19.39': dependencies: undici-types: 5.26.5 '@types/semver@7.5.0': {} + '@types/unist@3.0.2': {} + + '@types/web-bluetooth@0.0.20': {} + '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.10.0 @@ -2537,6 +3063,11 @@ snapshots: '@ungap/structured-clone@1.2.0': {} + '@vitejs/plugin-vue@5.0.5(vite@5.3.3(@types/node@18.19.39))(vue@3.4.33(typescript@5.4.5))': + dependencies: + vite: 5.3.3(@types/node@18.19.39) + vue: 3.4.33(typescript@5.4.5) + '@vitest/expect@2.0.2': dependencies: '@vitest/spy': 2.0.2 @@ -2570,6 +3101,108 @@ snapshots: loupe: 3.1.1 tinyrainbow: 1.2.0 + '@vue/compiler-core@3.4.33': + dependencies: + '@babel/parser': 7.24.8 + '@vue/shared': 3.4.33 + entities: 4.5.0 + estree-walker: 2.0.2 + source-map-js: 1.2.0 + + '@vue/compiler-dom@3.4.33': + dependencies: + '@vue/compiler-core': 3.4.33 + '@vue/shared': 3.4.33 + + '@vue/compiler-sfc@3.4.33': + dependencies: + '@babel/parser': 7.24.8 + '@vue/compiler-core': 3.4.33 + '@vue/compiler-dom': 3.4.33 + '@vue/compiler-ssr': 3.4.33 + '@vue/shared': 3.4.33 + estree-walker: 2.0.2 + magic-string: 0.30.10 + postcss: 8.4.39 + source-map-js: 1.2.0 + + '@vue/compiler-ssr@3.4.33': + dependencies: + '@vue/compiler-dom': 3.4.33 + '@vue/shared': 3.4.33 + + '@vue/devtools-api@7.3.6': + dependencies: + '@vue/devtools-kit': 7.3.6 + + '@vue/devtools-kit@7.3.6': + dependencies: + '@vue/devtools-shared': 7.3.6 + birpc: 0.2.17 + hookable: 5.5.3 + mitt: 3.0.1 + perfect-debounce: 1.0.0 + speakingurl: 14.0.1 + superjson: 2.2.1 + + '@vue/devtools-shared@7.3.6': + dependencies: + rfdc: 1.4.1 + + '@vue/reactivity@3.4.33': + dependencies: + '@vue/shared': 3.4.33 + + '@vue/runtime-core@3.4.33': + dependencies: + '@vue/reactivity': 3.4.33 + '@vue/shared': 3.4.33 + + '@vue/runtime-dom@3.4.33': + dependencies: + '@vue/reactivity': 3.4.33 + '@vue/runtime-core': 3.4.33 + '@vue/shared': 3.4.33 + csstype: 3.1.3 + + '@vue/server-renderer@3.4.33(vue@3.4.33(typescript@5.4.5))': + dependencies: + '@vue/compiler-ssr': 3.4.33 + '@vue/shared': 3.4.33 + vue: 3.4.33(typescript@5.4.5) + + '@vue/shared@3.4.33': {} + + '@vueuse/core@10.11.0(vue@3.4.33(typescript@5.4.5))': + dependencies: + '@types/web-bluetooth': 0.0.20 + '@vueuse/metadata': 10.11.0 + '@vueuse/shared': 10.11.0(vue@3.4.33(typescript@5.4.5)) + vue-demi: 0.14.8(vue@3.4.33(typescript@5.4.5)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + + '@vueuse/integrations@10.11.0(focus-trap@7.5.4)(vue@3.4.33(typescript@5.4.5))': + dependencies: + '@vueuse/core': 10.11.0(vue@3.4.33(typescript@5.4.5)) + '@vueuse/shared': 10.11.0(vue@3.4.33(typescript@5.4.5)) + vue-demi: 0.14.8(vue@3.4.33(typescript@5.4.5)) + optionalDependencies: + focus-trap: 7.5.4 + transitivePeerDependencies: + - '@vue/composition-api' + - vue + + '@vueuse/metadata@10.11.0': {} + + '@vueuse/shared@10.11.0(vue@3.4.33(typescript@5.4.5))': + dependencies: + vue-demi: 0.14.8(vue@3.4.33(typescript@5.4.5)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + acorn-jsx@5.3.2(acorn@8.12.1): dependencies: acorn: 8.12.1 @@ -2593,6 +3226,24 @@ snapshots: require-from-string: 2.0.2 uri-js: 4.4.1 + algoliasearch@4.24.0: + dependencies: + '@algolia/cache-browser-local-storage': 4.24.0 + '@algolia/cache-common': 4.24.0 + '@algolia/cache-in-memory': 4.24.0 + '@algolia/client-account': 4.24.0 + '@algolia/client-analytics': 4.24.0 + '@algolia/client-common': 4.24.0 + '@algolia/client-personalization': 4.24.0 + '@algolia/client-search': 4.24.0 + '@algolia/logger-common': 4.24.0 + '@algolia/logger-console': 4.24.0 + '@algolia/recommend': 4.24.0 + '@algolia/requester-browser-xhr': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@algolia/requester-node-http': 4.24.0 + '@algolia/transporter': 4.24.0 + ansi-regex@5.0.1: {} ansi-regex@6.0.1: {} @@ -2682,6 +3333,8 @@ snapshots: binary-extensions@2.3.0: {} + birpc@0.2.17: {} + brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 @@ -2745,8 +3398,14 @@ snapshots: commander@4.1.1: {} + commander@9.5.0: {} + concat-map@0.0.1: {} + copy-anything@3.0.5: + dependencies: + is-what: 4.1.16 + create-require@1.1.1: optional: true @@ -2756,6 +3415,8 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 + csstype@3.1.3: {} + debug@3.2.7: dependencies: ms: 2.1.2 @@ -2810,6 +3471,8 @@ snapshots: graceful-fs: 4.2.11 tapable: 2.2.1 + entities@4.5.0: {} + es-abstract@1.22.3: dependencies: array-buffer-byte-length: 1.0.0 @@ -3108,6 +3771,8 @@ snapshots: estraverse@5.3.0: {} + estree-walker@2.0.2: {} + estree-walker@3.0.3: dependencies: '@types/estree': 1.0.5 @@ -3179,6 +3844,10 @@ snapshots: flatted@3.3.1: {} + focus-trap@7.5.4: + dependencies: + tabbable: 6.2.0 + for-each@0.3.3: dependencies: is-callable: 1.2.7 @@ -3296,6 +3965,8 @@ snapshots: dependencies: function-bind: 1.1.2 + hookable@5.5.3: {} + human-signals@2.1.0: {} human-signals@5.0.0: {} @@ -3421,6 +4092,8 @@ snapshots: call-bind: 1.0.5 get-intrinsic: 1.2.2 + is-what@4.1.16: {} + isarray@2.0.5: {} isexe@2.0.0: {} @@ -3508,6 +4181,8 @@ snapshots: make-error@1.3.6: optional: true + mark.js@8.11.1: {} + merge-stream@2.0.0: {} merge2@1.4.1: {} @@ -3533,8 +4208,14 @@ snapshots: minipass@7.0.4: {} + minisearch@7.0.2: {} + + mitt@3.0.1: {} + ms@2.1.2: {} + mylas@2.1.13: {} + mz@2.7.0: dependencies: any-promise: 1.3.0 @@ -3652,12 +4333,18 @@ snapshots: pathval@2.0.0: {} + perfect-debounce@1.0.0: {} + picocolors@1.0.1: {} picomatch@2.3.1: {} pirates@4.0.6: {} + plimit-lit@1.6.1: + dependencies: + queue-lit: 1.5.2 + postcss-load-config@4.0.2(postcss@8.4.39)(ts-node@10.9.1(@swc/core@1.6.13)(@types/node@18.19.39)(typescript@5.4.5)): dependencies: lilconfig: 3.1.2 @@ -3672,6 +4359,8 @@ snapshots: picocolors: 1.0.1 source-map-js: 1.2.0 + preact@10.22.1: {} + prelude-ls@1.2.1: {} prettier-linter-helpers@1.0.0: @@ -3690,6 +4379,8 @@ snapshots: punycode@2.3.0: {} + queue-lit@1.5.2: {} + queue-microtask@1.2.3: {} react-is@16.13.1: {} @@ -3735,6 +4426,8 @@ snapshots: reusify@1.0.4: {} + rfdc@1.4.1: {} + rimraf@3.0.2: dependencies: glob: 7.2.3 @@ -3778,6 +4471,8 @@ snapshots: get-intrinsic: 1.2.2 is-regex: 1.1.4 + search-insights@2.15.0: {} + semver@6.3.1: {} semver@7.6.2: {} @@ -3801,6 +4496,11 @@ snapshots: shebang-regex@3.0.0: {} + shiki@1.11.0: + dependencies: + '@shikijs/core': 1.11.0 + '@types/hast': 3.0.4 + side-channel@1.0.4: dependencies: call-bind: 1.0.5 @@ -3821,6 +4521,8 @@ snapshots: dependencies: whatwg-url: 7.1.0 + speakingurl@14.0.1: {} + stackback@0.0.2: {} std-env@3.7.0: {} @@ -3893,12 +4595,18 @@ snapshots: pirates: 4.0.6 ts-interface-checker: 0.1.13 + superjson@2.2.1: + dependencies: + copy-anything: 3.0.5 + supports-color@7.2.0: dependencies: has-flag: 4.0.0 supports-preserve-symlinks-flag@1.0.0: {} + tabbable@6.2.0: {} + tapable@2.2.1: {} text-table@0.2.0: {} @@ -3919,6 +4627,8 @@ snapshots: tinyspy@3.0.0: {} + to-fast-properties@2.0.0: {} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 @@ -3956,6 +4666,15 @@ snapshots: '@swc/core': 1.6.13 optional: true + tsc-alias@1.8.10: + dependencies: + chokidar: 3.6.0 + commander: 9.5.0 + globby: 11.1.0 + mylas: 2.1.13 + normalize-path: 3.0.0 + plimit-lit: 1.6.1 + tsconfig-paths@3.15.0: dependencies: '@types/json5': 0.0.29 @@ -4100,6 +4819,53 @@ snapshots: '@types/node': 18.19.39 fsevents: 2.3.3 + vitepress@1.3.1(@algolia/client-search@4.24.0)(@types/node@18.19.39)(postcss@8.4.39)(search-insights@2.15.0)(typescript@5.4.5): + dependencies: + '@docsearch/css': 3.6.1 + '@docsearch/js': 3.6.1(@algolia/client-search@4.24.0)(search-insights@2.15.0) + '@shikijs/core': 1.11.0 + '@shikijs/transformers': 1.11.0 + '@types/markdown-it': 14.1.1 + '@vitejs/plugin-vue': 5.0.5(vite@5.3.3(@types/node@18.19.39))(vue@3.4.33(typescript@5.4.5)) + '@vue/devtools-api': 7.3.6 + '@vue/shared': 3.4.33 + '@vueuse/core': 10.11.0(vue@3.4.33(typescript@5.4.5)) + '@vueuse/integrations': 10.11.0(focus-trap@7.5.4)(vue@3.4.33(typescript@5.4.5)) + focus-trap: 7.5.4 + mark.js: 8.11.1 + minisearch: 7.0.2 + shiki: 1.11.0 + vite: 5.3.3(@types/node@18.19.39) + vue: 3.4.33(typescript@5.4.5) + optionalDependencies: + postcss: 8.4.39 + transitivePeerDependencies: + - '@algolia/client-search' + - '@types/node' + - '@types/react' + - '@vue/composition-api' + - async-validator + - axios + - change-case + - drauu + - fuse.js + - idb-keyval + - jwt-decode + - less + - lightningcss + - nprogress + - qrcode + - react + - react-dom + - sass + - search-insights + - sortablejs + - stylus + - sugarss + - terser + - typescript + - universal-cookie + vitest@2.0.2(@types/node@18.19.39): dependencies: '@ampproject/remapping': 2.3.0 @@ -4132,6 +4898,20 @@ snapshots: - supports-color - terser + vue-demi@0.14.8(vue@3.4.33(typescript@5.4.5)): + dependencies: + vue: 3.4.33(typescript@5.4.5) + + vue@3.4.33(typescript@5.4.5): + dependencies: + '@vue/compiler-dom': 3.4.33 + '@vue/compiler-sfc': 3.4.33 + '@vue/runtime-dom': 3.4.33 + '@vue/server-renderer': 3.4.33(vue@3.4.33(typescript@5.4.5)) + '@vue/shared': 3.4.33 + optionalDependencies: + typescript: 5.4.5 + webidl-conversions@4.0.2: {} whatwg-url@7.1.0: diff --git a/turbo.json b/turbo.json index d8a74d8..40a20b5 100644 --- a/turbo.json +++ b/turbo.json @@ -4,12 +4,21 @@ "build": { "dependsOn": ["^build"] }, + "build:report": { + "dependsOn": ["build"] + }, + "build:docs": { + "dependsOn": ["^build:docs", "build:report"] + }, "lint": { "dependsOn": ["^lint"] }, "test": { "dependsOn": ["^test"] }, + "ci:report": { + "dependsOn": ["build"] + }, "dev": { "cache": false, "persistent": true From 8850701471a62df4a4a779ac11bcfe841d5d1823 Mon Sep 17 00:00:00 2001 From: Zeyu Zhang <39144422+zeyu2001@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:34:34 +0800 Subject: [PATCH 2/2] feat: demo codeql workflow --- .github/workflows/codeql.yml | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..bbbee5e --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,50 @@ +name: "CodeQL" + +on: + push: + branches: ["develop"] + pull_request: + branches: ["develop"] + schedule: + - cron: "39 13 * * 2" + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: javascript-typescript + build-mode: none + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + # https://github.com/opengovsg/codeql-config/blob/develop/codeql-config.yml + config-file: opengovsg/codeql-config/codeql-config.yml@develop + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}"