From 482379a334bcaab5b81512291af34517abf8e499 Mon Sep 17 00:00:00 2001 From: Zeyu Zhang <39144422+zeyu2001@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:51:56 +0800 Subject: [PATCH] chore: exclude temp report files --- .gitignore | 2 +- .../temp/starter-kitty-validators.api.json | 572 ------------------ .../temp/starter-kitty-validators.api.md | 46 -- 3 files changed, 1 insertion(+), 619 deletions(-) delete mode 100644 packages/validators/temp/starter-kitty-validators.api.json delete mode 100644 packages/validators/temp/starter-kitty-validators.api.md diff --git a/.gitignore b/.gitignore index 5578ef6..fb21df8 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,7 @@ out/ build dist cache - +temp/ # Debug npm-debug.log* diff --git a/packages/validators/temp/starter-kitty-validators.api.json b/packages/validators/temp/starter-kitty-validators.api.json deleted file mode 100644 index dfc3d73..0000000 --- a/packages/validators/temp/starter-kitty-validators.api.json +++ /dev/null @@ -1,572 +0,0 @@ -{ - "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": "Function", - "canonicalReference": "@opengovsg/starter-kitty-validators!createEmailSchema:function(1)", - "docComment": "/**\n * Create a schema that validates emails against RFC 5322 and a whitelist of domains.\n *\n * @param options - The options to use for validation\n *\n * @returns A Zod schema that validates emails according to the provided options\n *\n * @throws\n *\n * {@link OptionsError} If the options are invalid\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "createEmailSchema: (options?: " - }, - { - "kind": "Reference", - "text": "EmailValidatorOptions", - "canonicalReference": "@opengovsg/starter-kitty-validators!EmailValidatorOptions:interface" - }, - { - "kind": "Content", - "text": ") => " - }, - { - "kind": "Reference", - "text": "ZodSchema", - "canonicalReference": "zod!ZodType:class" - }, - { - "kind": "Content", - "text": "" - } - ], - "fileUrlPath": "dist/email/index.d.ts", - "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 - }, - "releaseTag": "Public", - "overloadIndex": 1, - "parameters": [ - { - "parameterName": "options", - "parameterTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - }, - "isOptional": true - } - ], - "name": "createEmailSchema" - }, - { - "kind": "Interface", - "canonicalReference": "@opengovsg/starter-kitty-validators!EmailValidatorOptions:interface", - "docComment": "/**\n * The options to use for email validation.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface EmailValidatorOptions " - } - ], - "fileUrlPath": "dist/email/options.d.ts", - "releaseTag": "Public", - "name": "EmailValidatorOptions", - "preserveMemberOrder": false, - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "@opengovsg/starter-kitty-validators!EmailValidatorOptions#domains:member", - "docComment": "/**\n * The list of allowed domains for the domain part of the email address. If not provided, all domains are allowed.\n *\n * Each whitelisted domain must be specified as an object with the `domain` and `includeSubdomains` properties. By default, `includeSubdomains` is `false`, meaning only the exact domain is allowed. If `includeSubdomains` is `true`, all subdomains of the domain are also allowed.\n *\n * @example\n * ```javascript\n * [ { domain: 'gov.sg', includeSubdomains: true } ]\n * ```\n *\n * This will allow `gov.sg` and all subdomains of `gov.sg`, such as `open.gov.sg`.\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "domains?: " - }, - { - "kind": "Content", - "text": "{\n domain: string;\n includeSubdomains?: boolean;\n }[]" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": false, - "isOptional": true, - "releaseTag": "Public", - "name": "domains", - "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/common/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 * Parses URLs according to WHATWG standards and validates 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 * In most cases, you should provide your own whitelist with a list of allowed hostnames to prevent open redirects.\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": "UrlValidatorOptions", - "canonicalReference": "@opengovsg/starter-kitty-validators!UrlValidatorOptions: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": [] - }, - { - "kind": "Interface", - "canonicalReference": "@opengovsg/starter-kitty-validators!UrlValidatorOptions:interface", - "docComment": "/**\n * The options to use for URL validation.\n *\n * @public\n */\n", - "excerptTokens": [ - { - "kind": "Content", - "text": "export interface UrlValidatorOptions " - } - ], - "fileUrlPath": "dist/url/options.d.ts", - "releaseTag": "Public", - "name": "UrlValidatorOptions", - "preserveMemberOrder": false, - "members": [ - { - "kind": "PropertySignature", - "canonicalReference": "@opengovsg/starter-kitty-validators!UrlValidatorOptions#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!UrlValidatorOptions#whitelist:member", - "docComment": "/**\n * The list of allowed protocols and hostnames for URL validation. The default whitelist allows only `http` and `https` protocols, and does not restrict hostnames.\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": "UrlValidatorWhitelist", - "canonicalReference": "@opengovsg/starter-kitty-validators!~UrlValidatorWhitelist:type" - }, - { - "kind": "Content", - "text": ";" - } - ], - "isReadonly": false, - "isOptional": true, - "releaseTag": "Public", - "name": "whitelist", - "propertyTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } - } - ], - "extendsTokenRanges": [] - } - ] - } - ] -} diff --git a/packages/validators/temp/starter-kitty-validators.api.md b/packages/validators/temp/starter-kitty-validators.api.md deleted file mode 100644 index cd2a5a5..0000000 --- a/packages/validators/temp/starter-kitty-validators.api.md +++ /dev/null @@ -1,46 +0,0 @@ -## 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'; -import { ZodSchema } from 'zod'; - -// @public -export const createEmailSchema: (options?: EmailValidatorOptions) => ZodSchema; - -// @public -export interface EmailValidatorOptions { - domains?: { - domain: string; - includeSubdomains?: boolean; - }[]; -} - -// @public -export class OptionsError extends Error { - constructor(message: string); -} - -// @public -export class UrlValidationError extends Error { - constructor(message: string); -} - -// @public -export class UrlValidator { - constructor(options?: UrlValidatorOptions); - parse(url: string): URL; -} - -// @public -export interface UrlValidatorOptions { - baseOrigin?: string; - // Warning: (ae-forgotten-export) The symbol "UrlValidatorWhitelist" needs to be exported by the entry point index.d.ts - whitelist?: UrlValidatorWhitelist; -} - -```