From 142bec303f66b27d66cb1de5541005e60bcecff6 Mon Sep 17 00:00:00 2001 From: Sarthak Date: Thu, 16 May 2024 00:10:12 +0530 Subject: [PATCH 1/2] fix: module not found in docs (#24) --- api-extractor.json | 5 +- apps/wapijs.co/next.config.mjs | 9 +- apps/wapijs.co/package.json | 2 +- .../public/assets/library-usage-flow.mp4 | Bin 413345 -> 413342 bytes apps/wapijs.co/public/assets/usage-flow.gif | Bin 484306 -> 484295 bytes .../src/app/docs/[version]/layout.tsx | 3 + .../wapijs.co/src/app/docs/[version]/page.tsx | 3 + apps/wapijs.co/src/app/global-error.tsx | 33 + apps/wapijs.co/src/utils/api-extractor.ts | 8 +- apps/wapijs.co/tsconfig.json | 1 + package.json | 8 +- packages/wapi.js/package.json | 2 +- packages/wapi.js/src/manager/message/index.ts | 3 +- packages/wapi.js/temp/wapi.js.api.md | 4626 +++++++++++++++++ packages/wapi.js/tsdoc.json | 4 + patches/@microsoft__tsdoc-config@0.16.2.patch | 1459 ++++++ pnpm-lock.yaml | 41 +- tsdoc.json | 77 + 18 files changed, 6243 insertions(+), 41 deletions(-) create mode 100644 apps/wapijs.co/src/app/global-error.tsx create mode 100644 packages/wapi.js/temp/wapi.js.api.md create mode 100644 packages/wapi.js/tsdoc.json create mode 100644 patches/@microsoft__tsdoc-config@0.16.2.patch create mode 100644 tsdoc.json diff --git a/api-extractor.json b/api-extractor.json index d00ea4e..85d0e51 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -41,19 +41,18 @@ } } }, - "apiReport": { "enabled": false }, + "docModel": { "enabled": true, "apiJsonFilePath": "/docs/docs.api.json" }, "dtsRollup": { - "enabled": false, + "enabled": true, "untrimmedFilePath": "/dist/esm/index.d.ts" }, - "tsdocMetadata": {}, "newlineKind": "lf", "messages": { "compilerMessageReporting": { diff --git a/apps/wapijs.co/next.config.mjs b/apps/wapijs.co/next.config.mjs index c3bec89..4d16217 100644 --- a/apps/wapijs.co/next.config.mjs +++ b/apps/wapijs.co/next.config.mjs @@ -1,6 +1,9 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - -}; + reactStrictMode: true, + compiler: { + removeConsole: process.env.NODE_ENV === 'production' + } +} -export default nextConfig; +export default nextConfig diff --git a/apps/wapijs.co/package.json b/apps/wapijs.co/package.json index 05852b2..350c0a7 100644 --- a/apps/wapijs.co/package.json +++ b/apps/wapijs.co/package.json @@ -4,7 +4,7 @@ "scripts": { "dev": "NODE_ENV=development next dev", "build": "NODE_ENV=production next build", - "start": "NODE_ENV=production next start", + "start": "NODE_ENV=production next start ", "lint": "next lint", "pretty": "pnpm prettier --write \"src/**/*.{ts,tsx,css}\"" }, diff --git a/apps/wapijs.co/public/assets/library-usage-flow.mp4 b/apps/wapijs.co/public/assets/library-usage-flow.mp4 index 1aaa2e72fd9dbee6a8ba8a77691888bb61b5d055..ae780c84d4c3bdb6eac401dd743cc974d0248c9a 100644 GIT binary patch delta 45 vcmZ2DS90E5$qh9|n`@1V0yckWQdrt9sKE%tOhC*G#4JF}x?NC%ZGsvAj};D+ delta 51 zcmbO?S90N8$qh9|jJ%s`jEVw))Vn5yrHs7od>V{E%ml>DK+FQftlRlC*e0j}0J+W% Ar~m)} diff --git a/apps/wapijs.co/public/assets/usage-flow.gif b/apps/wapijs.co/public/assets/usage-flow.gif index fd4ac01c325d4d3801e535fc120da11e4d79ba0c..9be0755390240eb5a14aa0f2305fb2ae1a38f628 100644 GIT binary patch delta 79 zcmV-V0I>hk#~sJV9k5~8vtro2wznXU0UFo0J7xl;X}93d0t-pE>=*+RX@-IWhJpmP lf(62Fx5M!Ta4fep9tMU8x4R|=nzpxA-3H@mw>m}#m>uvhBdP!Z delta 104 zcmX?pT=vp&*$s&|7#gUL-|1QJs(*Mbbz#u99tU)klv)mHVb5q&t10189-X!jeUkJ0DdDT_5c6? diff --git a/apps/wapijs.co/src/app/docs/[version]/layout.tsx b/apps/wapijs.co/src/app/docs/[version]/layout.tsx index db982b4..c3f1847 100644 --- a/apps/wapijs.co/src/app/docs/[version]/layout.tsx +++ b/apps/wapijs.co/src/app/docs/[version]/layout.tsx @@ -4,6 +4,9 @@ import { resolveItemUri } from '~/reusable-function' import { notFound } from 'next/navigation' import { addPackageToModel, fetchDocumentationJsonDataFromSlug } from '~/utils/api-extractor' +export const revalidate = 60 * 60 * 24 * 30 +export const dynamicParams = true + export default async function VersionHomeLayout({ children, params diff --git a/apps/wapijs.co/src/app/docs/[version]/page.tsx b/apps/wapijs.co/src/app/docs/[version]/page.tsx index b9128bd..09e5def 100644 --- a/apps/wapijs.co/src/app/docs/[version]/page.tsx +++ b/apps/wapijs.co/src/app/docs/[version]/page.tsx @@ -8,6 +8,9 @@ import { readFile } from 'node:fs/promises' import getWasm from 'shiki/wasm' import { fetchVersions } from '~/reusable-function' +export const revalidate = 60 * 60 * 24 * 30 +export const dynamicParams = true + async function fetchReadMeFileFromGithub() { if (IS_DEVELOPMENT) { const fileContent = await readFile(join(process.cwd(), '..', '..', 'README.md'), 'utf8') diff --git a/apps/wapijs.co/src/app/global-error.tsx b/apps/wapijs.co/src/app/global-error.tsx new file mode 100644 index 0000000..5a889eb --- /dev/null +++ b/apps/wapijs.co/src/app/global-error.tsx @@ -0,0 +1,33 @@ +'use client' + +import Link from 'next/link' +import { Button } from '@wapijs/ui' +import { ArrowPathIcon, ChatBubbleBottomCenterIcon } from '@heroicons/react/24/solid' + +export default function GlobalError({ + reset, + error +}: { + error: Error & { digest?: string } + reset: () => void +}) { + console.log({ error: error, stack: error.stack }) + return ( +
+

+ Oops! Something went wrong{' '} +

+
+ + + + +
+
+ ) +} diff --git a/apps/wapijs.co/src/utils/api-extractor.ts b/apps/wapijs.co/src/utils/api-extractor.ts index 0e9ad13..0a27c08 100644 --- a/apps/wapijs.co/src/utils/api-extractor.ts +++ b/apps/wapijs.co/src/utils/api-extractor.ts @@ -18,7 +18,8 @@ import { type ResolvedParameter } from '~/types' import { TSDocConfiguration } from '@microsoft/tsdoc' import { TSDocConfigFile } from '@microsoft/tsdoc-config' import { readFile } from 'node:fs/promises' -import { join } from 'node:path' +import path, { join } from 'node:path' +import { readdirSync } from 'node:fs' export async function fetchDocumentationJsonDataFromSlug(version: string) { try { @@ -43,7 +44,7 @@ export async function fetchDocumentationJsonDataFromSlug(version: string) { return response } } catch (error) { - console.log(error) + console.error(error) return null } } @@ -188,6 +189,9 @@ export function parametersString(item: ApiDocumentedItem & ApiParameterListMixin } export function addPackageToModel(model: ApiModel, data: any) { + const nodeModulesPath = path.join(process.cwd(), 'node_modules') + const files = readdirSync(nodeModulesPath) + console.log('node_modules:', files) const tsdocConfiguration = new TSDocConfiguration() const tsdocConfigFile = TSDocConfigFile.loadFromObject(data.metadata.tsdocConfig) tsdocConfigFile.configureParser(tsdocConfiguration) diff --git a/apps/wapijs.co/tsconfig.json b/apps/wapijs.co/tsconfig.json index 7616a94..4d2519c 100644 --- a/apps/wapijs.co/tsconfig.json +++ b/apps/wapijs.co/tsconfig.json @@ -13,6 +13,7 @@ "**/*.tsx", ".next/types/**/*.ts", "tailwind.config.js", + "prettier.config.js", ".eslintrc.js" ], "exclude": ["node_modules"] diff --git a/package.json b/package.json index 150b520..aa222b1 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "devDependencies": { "@commitlint/cli": "^17.7.1", "@commitlint/config-conventional": "^17.7.0", + "@microsoft/api-extractor": "^7.43.1", "@semantic-release/git": "^10.0.1", "@semantic-release/github": "^10.0.3", "@types/node": "^20.5.9", @@ -64,5 +65,10 @@ "turbo": "^1.10.13", "typescript": "5.4.5" }, - "packageManager": "pnpm@9.1.0" + "packageManager": "pnpm@9.1.0", + "pnpm": { + "patchedDependencies": { + "@microsoft/tsdoc-config@0.16.2": "patches/@microsoft__tsdoc-config@0.16.2.patch" + } + } } diff --git a/packages/wapi.js/package.json b/packages/wapi.js/package.json index 2aec695..9781434 100644 --- a/packages/wapi.js/package.json +++ b/packages/wapi.js/package.json @@ -21,7 +21,7 @@ "lint": "pnpm eslint . --max-warnings=20", "pretty": "pnpm prettier --write \"src/**/*.ts\"", "clean-install": "rm -rf ./node_modules && pnpm install --frozen-lockfile", - "doc:gen": "api-extractor run --local" + "doc:gen": "api-extractor run --local --diagnostics" }, "keywords": [ "whatsapp", diff --git a/packages/wapi.js/src/manager/message/index.ts b/packages/wapi.js/src/manager/message/index.ts index 9985a43..8a35e63 100644 --- a/packages/wapi.js/src/manager/message/index.ts +++ b/packages/wapi.js/src/manager/message/index.ts @@ -13,8 +13,7 @@ import { type WapiMessageResponseSchemaType } from "../../client/schema"; */ export class MessageManager extends BaseManager - implements MessageManagerInterface -{ + implements MessageManagerInterface { client: Client; constructor(props: { client: Client }) { super(props.client); diff --git a/packages/wapi.js/temp/wapi.js.api.md b/packages/wapi.js/temp/wapi.js.api.md new file mode 100644 index 0000000..a2fd6f3 --- /dev/null +++ b/packages/wapi.js/temp/wapi.js.api.md @@ -0,0 +1,4626 @@ +## API Report File for "@wapijs/wapi.js" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +/// + +import type { default as default_2 } from 'events'; +import { EventEmitter } from 'node:events'; +import * as EventEmitter_2 from 'events'; +import { HeaderTypeEnum } from './structures/interaction/schema'; +import { MessageStatusEnum as MessageStatusEnum_2 } from '../../type'; +import { Request as Request_2 } from 'express'; +import { Response as Response_2 } from 'express'; +import { z } from 'zod'; +import { ZodSchema } from 'zod'; + +// @public +export class AdInteractionEvent extends MessageEvent implements AdInteractionEventInterface { + constructor(params: { + client: Client; + data: { + from: string; + id: string; + timestamp: string; + isForwarded: boolean; + text: string; + source: { + url: string; + id: string; + type: AdInteractionSourceTypeEnum; + title: string; + description: string; + mediaUrl?: string; + mediaType: AdInteractionSourceMediaTypeEnum; + thumbnailUrl: string; + ctwaClid: string; + }; + }; + }); + // (undocumented) + source: { + url: string; + id: string; + type: AdInteractionSourceTypeEnum; + title: string; + description: string; + mediaUrl?: string; + mediaType: AdInteractionSourceMediaTypeEnum; + thumbnailUrl: string; + ctwaClid: string; + }; + // (undocumented) + text: string; +} + +// @public +export interface AdInteractionEventInterface extends InteractionMessageEventInterface { + // (undocumented) + source: { + url: string; + id: string; + type: AdInteractionSourceTypeEnum; + title: string; + description: string; + mediaUrl?: string; + mediaType: AdInteractionSourceMediaTypeEnum; + thumbnailUrl: string; + ctwaClid: string; + }; + // (undocumented) + text: string; +} + +// @public +export enum AdInteractionSourceMediaTypeEnum { + // (undocumented) + Image = "image", + // (undocumented) + Video = "video" +} + +// @public +export enum AdInteractionSourceTypeEnum { + // (undocumented) + Ad = "ad", + // (undocumented) + Post = "post" +} + +// Warning: (ae-forgotten-export) The symbol "BaseMessage" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "MessageTypeEnum" needs to be exported by the entry point index.d.ts +// +// @public +export class AudioMessage extends BaseMessage implements AudioMessageInterface { + constructor(params: z.infer); + // Warning: (ae-forgotten-export) The symbol "MetaAudioMediaObjectSchemaType" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "ExternalAudioMediaObjectType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + data: z.infer; + // Warning: (ae-forgotten-export) The symbol "WhatsappCloudApiRequestPayloadSchemaType" needs to be exported by the entry point index.d.ts + toJson(params: { + to: string; + replyToMessageId?: string; + }): Extract, { + type: MessageTypeEnum.Audio; + }>; +} + +// @public +export class AudioMessageEvent extends MediaMessageEvent implements AudioMessageEventInterface { + constructor(params: { + client: Client; + data: { + audio: AudioMessage; + from: string; + messageId: string; + timestamp: string; + mimeType: string; + sha256: string; + mediaId: string; + isForwarded: boolean; + }; + }); + // (undocumented) + audio: AudioMessage; +} + +// @public +export interface AudioMessageEventInterface extends MediaMessageEventInterface { + audio: AudioMessage; +} + +// Warning: (ae-forgotten-export) The symbol "BaseMessageInterface" needs to be exported by the entry point index.d.ts +// +// @public +export interface AudioMessageInterface extends BaseMessageInterface { + // (undocumented) + data: z.infer; +} + +// @public +export class BaseEvent implements BaseEventInterface { + constructor(params: { + client: Client; + }); + // (undocumented) + client: Client; +} + +// @public +export interface BaseEventInterface { + client: Client; +} + +// @public +export class BaseManager implements BaseManagerInterface { + constructor(client: Client); + client: Client; +} + +// @public +export interface BaseManagerInterface { + client: Client; +} + +// Warning: (ae-forgotten-export) The symbol "InteractiveMessage" needs to be exported by the entry point index.d.ts +// +// @public +export class ButtonInteractionMessage extends InteractiveMessage implements ButtonInteractionMessageInterface { + constructor(params: { + buttons: { + id: string; + title: string; + }[]; + footerText?: string; + bodyText: string; + }); + addFooter(footerText: string): void; + addHeader(): void; + // (undocumented) + data: { + buttons: { + id: string; + title: string; + }[]; + }; + // Warning: (ae-forgotten-export) The symbol "InteractiveMessageApiPayloadSchemaType" needs to be exported by the entry point index.d.ts + toJson(params: { + to: string; + replyToMessageId?: string; + }): z.infer & { + interactive: z.infer; + }; +} + +// @public +export interface ButtonInteractionMessageInterface extends InteractiveMessageInterface { + // (undocumented) + data: { + buttons: { + id: string; + title: string; + }[]; + }; +} + +// @public +export interface ButtonReplyInteractionMessageEventInterface extends InteractionMessageEventInterface { + // (undocumented) + buttonId: string; + // (undocumented) + title: string; +} + +// Warning: (ae-forgotten-export) The symbol "ClientInterface" needs to be exported by the entry point index.d.ts +// +// @public +export class Client extends EventEmitter implements ClientInterface { + constructor(params: { + webhookSecret: string; + webhookEndpoint: string; + apiAccessToken: string; + phoneNumberId: string; + businessAccountId: string; + port: number; + }); + emit(eventName: T, data: WapiEventDataMap[T]): boolean; + static getClient(): typeof Client; + get getReadyAtTimestamp(): 0 | Date | null; + initiate(): void; + media: MediaManager; + message: MessageManager; + on(eventName: T, listener: (data: WapiEventDataMap[T]) => void): this; + phone: PhoneNumberManager; + get phoneNumberId(): string; + readyAtTimeStamp: number | null; + // Warning: (ae-forgotten-export) The symbol "RequestClient" needs to be exported by the entry point index.d.ts + requester: RequestClient; + // Warning: (ae-forgotten-export) The symbol "ClientStatusEnum" needs to be exported by the entry point index.d.ts + status: ClientStatusEnum | null; + set updateAccessToken(accessToken: string); + set updateSenderPhoneNumberId(phoneNumber: string); + get uptime(): number | null; + webhook: Webhook; +} + +// @public +export class Contact { + constructor(params: { + name: z.infer; + }); + addAddress(address: z.infer): void; + addEmail(email: z.infer): void; + addPhone(phone: z.infer): void; + // Warning: (ae-forgotten-export) The symbol "ContactAddressSchemaType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + addresses?: z.infer[]; + addUrl(url: z.infer): void; + // (undocumented) + birthday?: string; + // Warning: (ae-forgotten-export) The symbol "ContactEmailPayloadSchemaType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + emails?: z.infer[]; + // Warning: (ae-forgotten-export) The symbol "ContactNamePayloadSchemaType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + name: z.infer; + // Warning: (ae-forgotten-export) The symbol "ContactOrgPayloadSchemaType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + org?: z.infer; + // Warning: (ae-forgotten-export) The symbol "ContactPhonePayloadSchemaType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + phones?: z.infer[]; + setBirthday(date: string): void; + setFirstName(firstName: string): void; + setLastName(lastName: string): void; + setMiddleName(middleName: string): void; + setNamePrefix(prefix: string): void; + setNameSuffix(suffix: string): void; + setOrg(org: z.infer): void; + // Warning: (ae-forgotten-export) The symbol "ContactUrlPayloadSchemaType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + urls?: z.infer[]; +} + +// Warning: (ae-forgotten-export) The symbol "ContactMessageInterface" needs to be exported by the entry point index.d.ts +// +// @public +export class ContactMessage extends BaseMessage<"contacts"> implements ContactMessageInterface { + constructor(params: { + contacts: Contact[]; + }); + addContact(contact: Contact): void; + // (undocumented) + contacts: Contact[]; + toJson(params: { + to: string; + replyToMessageId?: string; + }): Extract, { + type: "contacts"; + }>; +} + +// @public +export class ContactMessageEvent extends MessageEvent implements ContactMessageEventInterface { + constructor(params: { + client: Client; + data: { + contact: ContactMessage; + from: string; + messageId: string; + timestamp: string; + isForwarded: boolean; + }; + }); + contact: ContactMessage; +} + +// @public +export interface ContactMessageEventInterface extends MessageEventInterface { + contact: ContactMessage; +} + +// @public +export class CustomerIdentityChangeEvent implements CustomerIdentityChangeEventInterface { + constructor(params: { + client: Client; + acknowledged: string; + creationTimestamp: string; + hash: string; + timestamp: string; + }); + acknowledged: string; + client: Client; + creationTimestamp: string; + hash: string; +} + +// @public +export interface CustomerIdentityChangeEventInterface { + acknowledged: string; + client: Client; + creationTimestamp: string; + hash: string; +} + +// @public +export class CustomerNumberChangeEvent implements CustomerNumberChangeEventInterface { + constructor(params: { + client: Client; + changeDescription: string; + newWaId: string; + timestamp: string; + oldWaId: string; + }); + changeDescription: string; + client: Client; + newWaId: string; + oldWaId: string; + timestamp: number; +} + +// @public +export interface CustomerNumberChangeEventInterface { + changeDescription: string; + client: Client; + newWaId: string; + oldWaId: string; + timestamp: number; +} + +// @public +export class DocumentMessage extends BaseMessage implements DocumentMessageInterface { + constructor(params: z.infer); + // Warning: (ae-forgotten-export) The symbol "MetaDocumentMediaObjectSchemaType" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "ExternalDocumentMediaObjectSchemaType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + data: z.infer; + toJson(params: { + to: string; + replyToMessageId?: string; + }): Extract, { + type: MessageTypeEnum.Document; + }>; +} + +// @public +export class DocumentMessageEvent extends MediaMessageEvent implements DocumentMessageEventInterface { + constructor(params: { + client: Client; + data: { + document: DocumentMessage; + from: string; + messageId: string; + timestamp: string; + mediaId: string; + mimeType: string; + sha256: string; + isForwarded: boolean; + }; + }); + document: DocumentMessage; +} + +// @public +export interface DocumentMessageEventInterface extends MediaMessageEventInterface { + document: DocumentMessage; +} + +// @public +export interface DocumentMessageInterface extends BaseMessageInterface { + // (undocumented) + data: z.infer; +} + +// @public +export class ImageMessage extends BaseMessage implements ImageMessageInterface { + constructor(params: z.infer); + // Warning: (ae-forgotten-export) The symbol "MetaImageMediaObjectSchemaType" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "ExternalImageMediaObjectType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + data: z.infer; + toJson(params: { + to: string; + replyToMessageId?: string; + }): Extract, { + type: MessageTypeEnum.Image; + }>; +} + +// @public +export class ImageMessageEvent extends MediaMessageEvent implements ImageMessageEventInterface { + constructor(params: { + client: Client; + data: { + image: ImageMessage; + from: string; + messageId: string; + timestamp: string; + mediaId: string; + mimeType: string; + sha256: string; + isForwarded: boolean; + }; + }); + image: ImageMessage; +} + +// @public +export interface ImageMessageEventInterface extends MediaMessageEventInterface { + image: ImageMessage; +} + +// @public +export interface ImageMessageInterface extends BaseMessageInterface { + // (undocumented) + data: z.infer; +} + +// @public +export abstract class InteractionEvent extends MessageEvent implements InteractionMessageEventInterface { + constructor(params: { + client: Client; + data: { + from: string; + messageId: string; + timestamp: string; + isForwarded: boolean; + }; + }); +} + +// @public +export type InteractionMessageEventInterface = MessageEventInterface; + +// @public +export enum InteractionNotificationTypeEnum { + // (undocumented) + ButtonReply = "button_reply", + // (undocumented) + ListReply = "list_reply" +} + +// @public +export interface InteractiveMessageInterface extends BaseMessageInterface { + // (undocumented) + interactiveMessageData: { + type: InteractiveMessageTypeEnum; + footerText?: string; + bodyText: string; + }; +} + +// @public +export enum InteractiveMessageTypeEnum { + // (undocumented) + Button = "button", + // (undocumented) + Catalog = "catalog_message", + // (undocumented) + Flow = "flow", + // (undocumented) + List = "list", + // (undocumented) + Product = "product", + // (undocumented) + ProductList = "product_list" +} + +// @public +export class ListInteractionEvent extends InteractionEvent implements ListInteractionMessageEventInterface { + constructor(params: { + client: Client; + data: { + from: string; + messageId: string; + timestamp: string; + title: string; + listId: string; + description: string; + isForwarded: boolean; + }; + }); + // (undocumented) + description: string; + // (undocumented) + listId: string; + // (undocumented) + title: string; +} + +// @public +export class ListInteractionMessage extends InteractiveMessage implements ListInteractionMessageInterface { + constructor(params: { + buttonText: string; + footerText?: string; + bodyText: string; + sections: z.infer[]; + }); + addFooter(footerText: string): void; + addHeader(): void; + addSection(section: z.infer): void; + // (undocumented) + data: { + buttonText: string; + sections: z.infer[]; + }; + toJson(params: { + to: string; + replyToMessageId?: string; + }): z.infer & { + interactive: z.infer; + }; +} + +// @public +export interface ListInteractionMessageEventInterface extends InteractionMessageEventInterface { + // (undocumented) + description: string; + // (undocumented) + listId: string; + // (undocumented) + title: string; +} + +// @public +export interface ListInteractionMessageInterface extends InteractiveMessageInterface { + // (undocumented) + data: { + buttonText: string; + sections: z.infer[]; + }; +} + +// @public +export class LocationMessage extends BaseMessage<"location"> implements LocationMessageInterface { + // Warning: (ae-forgotten-export) The symbol "LocationSchemaType" needs to be exported by the entry point index.d.ts + constructor(params: z.infer); + // (undocumented) + data: { + address?: string; + latitude: number; + longitude: number; + name?: string; + }; + toJson(params: { + to: string; + replyToMessageId?: string; + }): Extract, { + type: "location"; + }>; +} + +// @public +export class LocationMessageEvent extends MessageEvent implements LocationMessageEventInterface { + constructor(params: { + client: Client; + data: { + location: LocationMessage; + from: string; + messageId: string; + timestamp: string; + isForwarded: boolean; + }; + }); + location: LocationMessage; +} + +// @public +export interface LocationMessageEventInterface extends MessageEventInterface { + location: LocationMessage; +} + +// @public +export interface LocationMessageInterface extends BaseMessageInterface { + // (undocumented) + data: { + address?: string; + latitude: number; + longitude: number; + name?: string; + }; +} + +// @public +export class MediaManager extends BaseManager implements MediaManagerInterface { + constructor(props: { + client: Client; + }); + // (undocumented) + client: Client; + delete(mediaId: string): Promise; + // Warning: (ae-forgotten-export) The symbol "GetMediaUrlResponseBodySchemaType" needs to be exported by the entry point index.d.ts + getUrl(mediaId: string): Promise>; + upload(params: { + filePath: string; + mediaType: string; + }): Promise; +} + +// @public +export interface MediaManagerInterface extends BaseManagerInterface { + delete: (mediaId: string) => Promise; + getUrl: (mediaId: string) => Promise>; + upload: (params: { + filePath: string; + mediaType: string; + }) => Promise; +} + +// @public +export abstract class MediaMessageEvent extends MessageEvent implements MediaMessageEventInterface { + constructor(params: { + client: Client; + from: string; + messageId: string; + timestamp: string; + mediaId: string; + mimeType: string; + sha256: string; + isForwarded: boolean; + }); + getUrl(): Promise; + // (undocumented) + mediaId: string; + // (undocumented) + mimeType: string; + // (undocumented) + sha256: string; +} + +// @public +export interface MediaMessageEventInterface extends MessageEventInterface { + getUrl: () => Promise; + mediaId: string; + mimeType: string; + sha256: string; +} + +// @public +export interface MediaMessageInterface { + // (undocumented) + caption?: string; + // (undocumented) + fileName?: string; + // (undocumented) + id?: string; + // (undocumented) + link?: string; + // (undocumented) + type: MediaTypeEnum; +} + +// @public +export enum MediaTypeEnum { + // (undocumented) + Audio = "audio", + // (undocumented) + Document = "document", + // (undocumented) + Image = "image", + // (undocumented) + Sticker = "sticker", + // (undocumented) + Video = "video" +} + +// @public +export type MessageContext = { + from: string; +}; + +// @public +export class MessageDeliveryEvent extends StatusUpdateEvent implements MessageDeliveryEventInterface { + constructor(params: { + client: Client; + data: { + from: string; + timestamp: string; + }; + }); +} + +// @public +export type MessageDeliveryEventInterface = StatusUpdateEventInterface; + +// @public +export abstract class MessageEvent extends BaseEvent implements MessageEventInterface { + constructor(params: { + client: Client; + id: string; + from: string; + timestamp: string; + isForwarded: boolean; + }); + // (undocumented) + context: MessageContext; + // (undocumented) + isForwarded: boolean; + // (undocumented) + messageId: string; + react(params: { + emoji: string; + phoneNumber: string; + }): Promise<{ + status: "success"; + data: { + status: MessageStatusEnum_2; + messageId: string; + receiverPhoneNumber: string; + senderPhoneNumber: string; + }; + } | { + status: "error"; + error: { + title: string; + description: string; + errorCode: number; + errorSubCode?: string | undefined; + }; + }>; + read(): Promise<{ + status: "success"; + data: { + status: MessageStatusEnum_2; + messageId: string; + receiverPhoneNumber: string; + senderPhoneNumber: string; + }; + } | { + status: "error"; + error: { + title: string; + description: string; + errorCode: number; + errorSubCode?: string | undefined; + }; + }>; + // Warning: (ae-forgotten-export) The symbol "WapiMessageResponseSchemaType" needs to be exported by the entry point index.d.ts + reply>(props: { + message: T; + }): Promise>; + // (undocumented) + timestamp: number; +} + +// @public +export interface MessageEventInterface extends BaseEventInterface { + context: MessageContext; + messageId: string; + timestamp: number; +} + +// @public +export class MessageFailedEvent extends StatusUpdateEvent implements MessageFailedEventInterface { + constructor(params: { + client: Client; + data: { + from: string; + timestamp: string; + failReason: string; + }; + }); + // (undocumented) + failReason: string; +} + +// @public +export interface MessageFailedEventInterface extends StatusUpdateEventInterface { + failReason: string; +} + +// @public +export class MessageManager extends BaseManager implements MessageManagerInterface { + constructor(props: { + client: Client; + }); + // (undocumented) + client: Client; + reply>(props: { + replyToMessageId: string; + message: T; + phoneNumber: string; + }): Promise>; + send>(props: { + message: T; + phoneNumber: string; + }): Promise>; +} + +// @public +export interface MessageManagerInterface extends BaseManagerInterface { + client: Client; + reply>(props: { + replyToMessageId: string; + message: T; + phoneNumber: string; + }): Promise>; + send>(props: { + message: T; + phoneNumber: string; + }): Promise>; +} + +// @public +export class MessageReadEvent extends StatusUpdateEvent implements MessageReadEventInterface { + constructor(params: { + client: Client; + data: { + from: string; + timestamp: string; + }; + }); +} + +// @public +export type MessageReadEventInterface = StatusUpdateEventInterface; + +// @public +export class MessageSentEvent extends StatusUpdateEvent implements MessageSentEventInterface { + constructor(params: { + client: Client; + data: { + from: string; + timestamp: string; + }; + }); +} + +// @public +export type MessageSentEventInterface = StatusUpdateEventInterface; + +// @public +export enum MessageStatusCategoryEnum { + // (undocumented) + Authentication = "authentication", + // (undocumented) + Marketing = "marketing", + // (undocumented) + ReferralConversion = "referral_conversion", + // (undocumented) + Service = "service", + // (undocumented) + Utility = "utility" +} + +// @public +export enum MessageStatusEnum { + // (undocumented) + Delivered = "delivered", + // (undocumented) + Failed = "failed", + // (undocumented) + Read = "read", + // (undocumented) + Sent = "sent" +} + +// @public +export class MessageUndeliveredEvent extends StatusUpdateEvent implements MessageUndeliveredEventInterface { + constructor(params: { + client: Client; + data: { + from: string; + timestamp: string; + }; + }); +} + +// @public +export type MessageUndeliveredEventInterface = StatusUpdateEventInterface; + +// @public +export enum NotificationEventTypeEnum { + // (undocumented) + AdInteraction = "AdInteraction", + // (undocumented) + AudioMessage = "AudioMessage", + // (undocumented) + ButtonInteraction = "ButtonInteraction", + // (undocumented) + ContactsMessage = "ContactsMessage", + // (undocumented) + CustomerIdentityChanged = "CustomerIdentityChanged", + // (undocumented) + CustomerNumberChanged = "CustomerNumberChanged", + // (undocumented) + DocumentMessage = "DocumentMessage", + // (undocumented) + ImageMessage = "ImageMessage", + // (undocumented) + ListInteraction = "ListInteraction", + // (undocumented) + LocationMessage = "LocationMessage", + // (undocumented) + MessageDeleted = "MessageDeleted", + // (undocumented) + MessageDelivered = "MessageDelivered", + // (undocumented) + MessageFailed = "MessageFailed", + // (undocumented) + MessageRead = "MessageRead", + // (undocumented) + MessageSent = "MessageSent", + // (undocumented) + MessageUndelivered = "MessageUndelivered", + // (undocumented) + OrderReceived = "OrderReceived", + // (undocumented) + ProductInquiry = "ProductInquiry", + // (undocumented) + Reaction = "Reaction", + // (undocumented) + ReplyMessage = "ReplyMessage", + // (undocumented) + StickerMessage = "StickerMessage", + // (undocumented) + TextMessage = "TextMessage", + // (undocumented) + UnknownEvent = "UnknownEvent", + // (undocumented) + VideoMessage = "VideoMessage" +} + +// @public +export enum NotificationMessageTypeEnum { + // (undocumented) + Audio = "audio", + // (undocumented) + Button = "button", + // (undocumented) + Contacts = "contacts", + // (undocumented) + Document = "document", + // (undocumented) + Image = "image", + // (undocumented) + Interactive = "interactive", + // (undocumented) + Location = "location", + // (undocumented) + Order = "order", + // (undocumented) + Reaction = "reaction", + // (undocumented) + Sticker = "sticker", + // (undocumented) + System = "system", + // (undocumented) + Text = "text", + // (undocumented) + Unknown = "unknown", + // (undocumented) + Video = "Video" +} + +// @public (undocumented) +export const NotificationPayloadAudioMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + audio: z.ZodObject<{ + id: z.ZodString; + mime_type: z.ZodString; + sha256: z.ZodString; + }, "strip", z.ZodTypeAny, { + id: string; + mime_type: string; + sha256: string; + }, { + id: string; + mime_type: string; + sha256: string; + }>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; +}, { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; +}>; + +// @public (undocumented) +export const NotificationPayloadButtonMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + button: z.ZodObject<{ + payload: z.ZodString; + text: z.ZodString; + }, "strip", z.ZodTypeAny, { + text: string; + payload: string; + }, { + text: string; + payload: string; + }>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; +}, { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; +}>; + +// @public (undocumented) +export const NotificationPayloadContactMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + contacts: z.ZodArray, "many">; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; +}, { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; +}>; + +// @public (undocumented) +export const NotificationPayloadDocumentMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + document: z.ZodObject<{ + id: z.ZodString; + mime_type: z.ZodString; + sha256: z.ZodString; + caption: z.ZodOptional; + filename: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; +}, { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; +}>; + +// @public (undocumented) +export const NotificationPayloadErrorSchemaType: z.ZodObject<{ + code: z.ZodNumber; + title: z.ZodString; + message: z.ZodString; + error_data: z.ZodObject<{ + details: z.ZodString; + }, "strip", z.ZodTypeAny, { + details: string; + }, { + details: string; + }>; +}, "strip", z.ZodTypeAny, { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; +}, { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; +}>; + +// @public (undocumented) +export const NotificationPayloadImageMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + image: z.ZodObject<{ + id: z.ZodString; + mime_type: z.ZodString; + sha256: z.ZodString; + caption: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; +}, { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; +}>; + +// @public (undocumented) +export const NotificationPayloadInteractionMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + interactive: z.ZodIntersection; + }, "strip", z.ZodTypeAny, { + type: InteractionNotificationTypeEnum; + }, { + type: InteractionNotificationTypeEnum; + }>, z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral; + button_reply: z.ZodObject<{ + id: z.ZodString; + title: z.ZodString; + }, "strip", z.ZodTypeAny, { + id: string; + title: string; + }, { + id: string; + title: string; + }>; + }, "strip", z.ZodTypeAny, { + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + }, { + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + }>, z.ZodObject<{ + type: z.ZodLiteral; + list_reply: z.ZodObject<{ + id: z.ZodString; + title: z.ZodString; + description: z.ZodString; + }, "strip", z.ZodTypeAny, { + id: string; + title: string; + description: string; + }, { + id: string; + title: string; + description: string; + }>; + }, "strip", z.ZodTypeAny, { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }, { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }>]>>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); +}, { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); +}>; + +// @public (undocumented) +export const NotificationPayloadLocationMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + location: z.ZodObject<{ + latitude: z.ZodNumber; + longitude: z.ZodNumber; + name: z.ZodOptional; + address: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }, { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; +}, { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; +}>; + +// @public (undocumented) +export const NotificationPayloadMessageContextSchemaType: z.ZodOptional; + frequently_forwarded: z.ZodOptional; + from: z.ZodOptional; + id: z.ZodString; + referred_product: z.ZodOptional>; +}, "strip", z.ZodTypeAny, { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; +}, { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; +}>>; + +// @public (undocumented) +export const NotificationPayloadOrderMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + text: z.ZodString; + order: z.ZodObject<{ + catalog_id: z.ZodString; + product_items: z.ZodArray, "many">; + }, "strip", z.ZodTypeAny, { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }, { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; +}, { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; +}>; + +// @public (undocumented) +export const NotificationPayloadReactionMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + reaction: z.ZodObject<{ + message_id: z.ZodString; + emoji: z.ZodString; + }, "strip", z.ZodTypeAny, { + message_id: string; + emoji: string; + }, { + message_id: string; + emoji: string; + }>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; +}, { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; +}>; + +// @public (undocumented) +export const NotificationPayloadStickerMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + sticker: z.ZodObject<{ + id: z.ZodString; + mime_type: z.ZodString; + sha256: z.ZodString; + animated: z.ZodBoolean; + }, "strip", z.ZodTypeAny, { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }, { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; +}, { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; +}>; + +// @public (undocumented) +export const NotificationPayloadSystemMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + system: z.ZodObject<{ + identity: z.ZodString; + body: z.ZodString; + customer: z.ZodString; + type: z.ZodNativeEnum; + wa_id: z.ZodString; + }, "strip", z.ZodTypeAny, { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }, { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }>; + identity: z.ZodObject<{ + acknowledged: z.ZodString; + created_timestamp: z.ZodString; + hash: z.ZodString; + }, "strip", z.ZodTypeAny, { + acknowledged: string; + created_timestamp: string; + hash: string; + }, { + acknowledged: string; + created_timestamp: string; + hash: string; + }>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; +}, { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; +}>; + +// @public (undocumented) +export const NotificationPayloadTextMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + text: z.ZodObject<{ + body: z.ZodString; + }, "strip", z.ZodTypeAny, { + body: string; + }, { + body: string; + }>; + referral: z.ZodOptional; + source_id: z.ZodString; + headline: z.ZodString; + body: z.ZodString; + image_url: z.ZodOptional; + video_url: z.ZodOptional; + thumbnail_url: z.ZodString; + ctwa_clid: z.ZodString; + media_type: z.ZodNativeEnum; + }, "strip", z.ZodTypeAny, { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + }, { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + }>>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; +}, { + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; +}>; + +// @public (undocumented) +export const NotificationPayloadUnknownMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Unknown; +}, { + type: NotificationMessageTypeEnum.Unknown; +}>; + +// @public (undocumented) +export const NotificationPayloadVideoMessageSchemaType: z.ZodObject<{ + type: z.ZodLiteral; + video: z.ZodObject<{ + id: z.ZodString; + mime_type: z.ZodString; + sha256: z.ZodString; + caption: z.ZodOptional; + filename: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }>; +}, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; +}, { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; +}>; + +// @public (undocumented) +export const NotificationReasonEnum: z.ZodEnum<["message"]>; + +// @public +export class OrderMessageEvent extends MessageEvent implements OrderMessageEventInterface { + constructor(params: { + client: Client; + data: { + order: Order; + from: string; + messageId: string; + timestamp: string; + isForwarded: boolean; + }; + }); + // Warning: (ae-forgotten-export) The symbol "Order" needs to be exported by the entry point index.d.ts + // + // (undocumented) + order: Order; +} + +// @public +export interface OrderMessageEventInterface extends MessageEventInterface { + order: Order; +} + +// @public +export class PhoneNumberManager extends BaseManager implements PhoneNumberManagerInterface { + constructor(props: { + client: Client; + }); + sendVerificationCode(phoneNumber: string): Promise; + verifyCode(code: string): Promise; +} + +// @public +export interface PhoneNumberManagerInterface extends BaseManagerInterface { + sendVerificationCode: (phoneNumber: string) => Promise; + verifyCode: (code: string) => Promise; +} + +// @public +export class ProductInquiryEvent extends MessageEvent implements ProductInquiryEventInterface { + constructor(params: { + client: Client; + data: { + productId: string; + catalogId: string; + from: string; + id: string; + timestamp: string; + isForwarded: boolean; + text: string; + }; + }); + catalogId: string; + productId: string; + text: string; +} + +// @public +export interface ProductInquiryEventInterface extends MessageEventInterface { + catalogId: string; + productId: string; + text: string; +} + +// @public +export class ProductInteractionMessage extends InteractiveMessage implements ProductInteractionMessageInterface { + constructor(params: { + buttonText: string; + footerText?: string; + bodyText: string; + catalogId: string; + productRetailerId: string; + }); + addFooter(footerText: string): void; + addHeader(): void; + // (undocumented) + data: { + catalogId: string; + productRetailerId: string; + }; + toJson(params: { + to: string; + replyToMessageId?: string; + }): z.infer & { + interactive: z.infer; + }; +} + +// @public +export interface ProductInteractionMessageInterface extends InteractiveMessageInterface { + // (undocumented) + data: { + catalogId: string; + productRetailerId: string; + }; +} + +// @public +export class ProductListInteractionMessage extends InteractiveMessage implements ProductListInteractionMessageInterface { + constructor(params: { + buttonText: string; + footerText?: string; + bodyText: string; + catalogId: string; + productRetailerId: string; + sections: z.infer[]; + header: z.infer; + }); + addFooter(footerText: string): void; + addSection(section: z.infer): void; + // (undocumented) + data: { + catalogId: string; + productRetailerId: string; + sections: z.infer[]; + }; + toJson(params: { + to: string; + replyToMessageId?: string; + }): z.infer & { + interactive: z.infer; + }; +} + +// @public +export interface ProductListInteractionMessageInterface extends InteractiveMessageInterface { + // (undocumented) + data: { + catalogId: string; + productRetailerId: string; + sections: z.infer[]; + }; +} + +// @public +export class QuickReplyButtonInteractionEvent extends InteractionEvent implements QuickReplyButtonInteractionEventInterface { + constructor(params: { + client: Client; + data: { + from: string; + messageId: string; + timestamp: string; + isForwarded: boolean; + buttonText: string; + buttonPayload: string; + }; + }); + // (undocumented) + button: { + text: string; + payload: string; + }; +} + +// @public +export interface QuickReplyButtonInteractionEventInterface extends InteractionMessageEventInterface { + // (undocumented) + button: { + text: string; + payload: string; + }; +} + +// @public +export class ReactionEvent extends MessageEvent implements ReactionEventInterface { + constructor(params: { + client: Client; + data: { + reaction: ReactionMessage; + from: string; + id: string; + timestamp: string; + isForwarded: boolean; + }; + }); + reaction: ReactionMessage; +} + +// @public +export interface ReactionEventInterface extends MessageEventInterface { + reaction: ReactionMessage; +} + +// @public +export class ReactionMessage extends BaseMessage implements ReactionMessageInterface { + constructor(params: { + messageId: string; + emoji: string; + }); + // (undocumented) + data: { + messageId: string; + emoji: string; + }; + toJson(params: { + to: string; + }): Extract, { + type: MessageTypeEnum.Reaction; + }>; +} + +// @public +export interface ReactionMessageInterface extends BaseMessageInterface { + // (undocumented) + data: { + messageId: string; + emoji: string; + }; +} + +// @public +export class ReplyButtonInteractionEvent extends InteractionEvent implements ButtonReplyInteractionMessageEventInterface { + constructor(params: { + client: Client; + data: { + from: string; + messageId: string; + timestamp: string; + isForwarded: boolean; + title: string; + buttonId: string; + }; + }); + // (undocumented) + buttonId: string; + // (undocumented) + title: string; +} + +// @public +export abstract class StatusUpdateEvent extends BaseEvent implements StatusUpdateEventInterface { + constructor(params: { + client: Client; + from: string; + timestamp: string; + }); + // (undocumented) + context: MessageContext; + // (undocumented) + timestamp: number; +} + +// @public +export interface StatusUpdateEventInterface extends BaseEventInterface { + context: MessageContext; + timestamp: number; +} + +// @public +export class StickerMessage extends BaseMessage implements StickerMessageInterface { + constructor(params: z.infer); + // Warning: (ae-forgotten-export) The symbol "MetaStickerMediaObjectSchemaType" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "ExternalStickerMediaObjectType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + data: z.infer; + toJson(params: { + to: string; + replyToMessageId?: string; + }): Extract, { + type: MessageTypeEnum.Sticker; + }>; +} + +// @public +export class StickerMessageEvent extends MediaMessageEvent implements StickerMessageEventInterface { + constructor(params: { + client: Client; + data: { + sticker: StickerMessage; + from: string; + messageId: string; + timestamp: string; + mediaId: string; + mimeType: string; + sha256: string; + isForwarded: boolean; + }; + }); + sticker: StickerMessage; +} + +// @public +export interface StickerMessageEventInterface extends MediaMessageEventInterface { + sticker: StickerMessage; +} + +// @public +export interface StickerMessageInterface extends BaseMessageInterface { + // (undocumented) + data: z.infer; +} + +// @public +export enum SystemNotificationTypeEnum { + // (undocumented) + CustomerIdentityChange = "customer_identity_changed", + // (undocumented) + CustomerNumberChange = "user_changed_number" +} + +// @public +export class TextMessage extends BaseMessage<"text"> implements TextMessageInterface { + constructor(params: { + text: string; + allowPreview?: true; + }); + // (undocumented) + readonly data: { + text: string; + allowPreview?: true; + }; + toJson(params: { + to: string; + replyToMessageId?: string; + }): Extract, { + type: "text"; + }>; +} + +// @public +export class TextMessageEvent extends MessageEvent implements TextMessageEventInterface { + constructor(params: { + client: Client; + data: { + from: string; + messageId: string; + text: TextMessage; + timestamp: string; + isForwarded: boolean; + }; + }); + text: TextMessage; +} + +// @public +export interface TextMessageEventInterface extends MessageEventInterface { + // (undocumented) + text: TextMessage; +} + +// @public +export interface TextMessageInterface extends BaseMessageInterface { + data: { + text: string | null; + }; + toJson: (params: { + to: string; + }) => Extract, { + type: "text"; + }>; +} + +// @public +export class UnknownEvent implements UnknownEventInterface { + constructor(params: { + code: string; + message: string; + title: string; + }); + code: string; + message: string; + title: string; +} + +// @public +export interface UnknownEventInterface { + code: string; + message: string; + title: string; +} + +// @public +export class VideoMessage extends BaseMessage implements VideoMessageInterface { + constructor(params: z.infer); + // Warning: (ae-forgotten-export) The symbol "MetaVideoMediaObjectSchemaType" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "ExternalVideoMediaObjectType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + data: z.infer; + toJson(params: { + to: string; + replyToMessageId?: string; + }): Extract, { + type: MessageTypeEnum.Video; + }>; +} + +// @public +export class VideoMessageEvent extends MediaMessageEvent implements VideoMessageEventInterface { + constructor(params: { + client: Client; + data: { + video: VideoMessage; + from: string; + messageId: string; + timestamp: string; + mediaId: string; + mimeType: string; + sha256: string; + isForwarded: boolean; + }; + }); + video: VideoMessage; +} + +// @public +export interface VideoMessageEventInterface extends MediaMessageEventInterface { + video: VideoMessage; +} + +// @public +export interface VideoMessageInterface extends BaseMessageInterface { + // (undocumented) + data: z.infer; +} + +// @public +export type WapiEventDataMap = { + TextMessage: TextMessageEvent; + AudioMessage: AudioMessageEvent; + AdInteraction: AdInteractionEvent; + ContactsMessage: ContactMessageEvent; + QuickReplyButtonInteraction: QuickReplyButtonInteractionEvent; + ReplyButtonInteraction: ReplyButtonInteractionEvent; + CustomerIdentityChanged: CustomerIdentityChangeEvent; + CustomerNumberChanged: CustomerNumberChangeEvent; + DocumentMessage: DocumentMessageEvent; + ImageMessage: ImageMessageEvent; + ListInteraction: ListInteractionEvent; + LocationMessage: LocationMessageEvent; + MessageDelivered: MessageDeliveryEvent; + MessageFailed: MessageFailedEvent; + MessageRead: MessageReadEvent; + MessageSent: MessageSentEvent; + MessageUndelivered: MessageUndeliveredEvent; + OrderReceived: OrderMessageEvent; + ProductInquiry: ProductInquiryEvent; + Reaction: ReactionEvent; + StickerMessage: StickerMessageEvent; + UnknownEvent: UnknownEvent; + VideoMessage: VideoMessageEvent; + ["Error"]: Error; + ["Warn"]: string; + ["Ready"]: null; +}; + +// Warning: (ae-forgotten-export) The symbol "WebhookInterface" needs to be exported by the entry point index.d.ts +// +// @public +export class Webhook extends EventEmitter_2 implements WebhookInterface { + constructor(params: { + client: Client; + webhookSecret: string; + webhookEndpoint: string; + port: number; + }); + getEndpoint(): string; + getPort(): number; + isListening(): boolean; + listen(cb: () => void): void; + _postRequestHandler(request: Request_2, response: Response_2): void; + setEndpoint(path: string): void; + setPort(port: number): void; +} + +// @public (undocumented) +export const WhatsappApiNotificationPayloadSchemaType: z.ZodObject<{ + object: z.ZodString; + entry: z.ZodArray; + contacts: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + wa_id: string; + profile: { + name: string; + }; + }, { + wa_id: string; + profile: { + name: string; + }; + }>, "many">>; + statuses: z.ZodOptional; + expiration_timestamp: z.ZodOptional>; + }, "strip", z.ZodTypeAny, { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }, { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }>; + }, "strip", z.ZodTypeAny, { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + }, { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + }>>; + errors: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }, { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }>, "many">>; + status: z.ZodNativeEnum; + timestamp: z.ZodString; + recipient_id: z.ZodString; + pricing: z.ZodOptional; + category: z.ZodNativeEnum; + }, "strip", z.ZodTypeAny, { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + }, { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + }>>; + }, "strip", z.ZodTypeAny, { + status: MessageStatusEnum; + timestamp: string; + recipient_id: string; + conversation?: { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + pricing?: { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + } | undefined; + }, { + status: MessageStatusEnum; + timestamp: string; + recipient_id: string; + conversation?: { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + pricing?: { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + } | undefined; + }>, "many">>; + messages: z.ZodOptional; + context: z.ZodOptional; + frequently_forwarded: z.ZodOptional; + from: z.ZodOptional; + id: z.ZodString; + referred_product: z.ZodOptional>; + }, "strip", z.ZodTypeAny, { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + }, { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + }>>; + errors: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }, { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }>, "many">>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum; + id: string; + from: string; + timestamp: string; + context?: { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + }, { + type: NotificationMessageTypeEnum; + id: string; + from: string; + timestamp: string; + context?: { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + }>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral; + audio: z.ZodObject<{ + id: z.ZodString; + mime_type: z.ZodString; + sha256: z.ZodString; + }, "strip", z.ZodTypeAny, { + id: string; + mime_type: string; + sha256: string; + }, { + id: string; + mime_type: string; + sha256: string; + }>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; + }, { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; + }>, z.ZodObject<{ + type: z.ZodLiteral; + text: z.ZodObject<{ + body: z.ZodString; + }, "strip", z.ZodTypeAny, { + body: string; + }, { + body: string; + }>; + referral: z.ZodOptional; + source_id: z.ZodString; + headline: z.ZodString; + body: z.ZodString; + image_url: z.ZodOptional; + video_url: z.ZodOptional; + thumbnail_url: z.ZodString; + ctwa_clid: z.ZodString; + media_type: z.ZodNativeEnum; + }, "strip", z.ZodTypeAny, { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + }, { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + }>>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; + }, { + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + image: z.ZodObject<{ + id: z.ZodString; + mime_type: z.ZodString; + sha256: z.ZodString; + caption: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; + }, { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + button: z.ZodObject<{ + payload: z.ZodString; + text: z.ZodString; + }, "strip", z.ZodTypeAny, { + text: string; + payload: string; + }, { + text: string; + payload: string; + }>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; + }, { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + document: z.ZodObject<{ + id: z.ZodString; + mime_type: z.ZodString; + sha256: z.ZodString; + caption: z.ZodOptional; + filename: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + }, { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + text: z.ZodString; + order: z.ZodObject<{ + catalog_id: z.ZodString; + product_items: z.ZodArray, "many">; + }, "strip", z.ZodTypeAny, { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }, { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; + }, { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + sticker: z.ZodObject<{ + id: z.ZodString; + mime_type: z.ZodString; + sha256: z.ZodString; + animated: z.ZodBoolean; + }, "strip", z.ZodTypeAny, { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }, { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; + }, { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + system: z.ZodObject<{ + identity: z.ZodString; + body: z.ZodString; + customer: z.ZodString; + type: z.ZodNativeEnum; + wa_id: z.ZodString; + }, "strip", z.ZodTypeAny, { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }, { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }>; + identity: z.ZodObject<{ + acknowledged: z.ZodString; + created_timestamp: z.ZodString; + hash: z.ZodString; + }, "strip", z.ZodTypeAny, { + acknowledged: string; + created_timestamp: string; + hash: string; + }, { + acknowledged: string; + created_timestamp: string; + hash: string; + }>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; + }, { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + video: z.ZodObject<{ + id: z.ZodString; + mime_type: z.ZodString; + sha256: z.ZodString; + caption: z.ZodOptional; + filename: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }, { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + }, { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + interactive: z.ZodIntersection; + }, "strip", z.ZodTypeAny, { + type: InteractionNotificationTypeEnum; + }, { + type: InteractionNotificationTypeEnum; + }>, z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral; + button_reply: z.ZodObject<{ + id: z.ZodString; + title: z.ZodString; + }, "strip", z.ZodTypeAny, { + id: string; + title: string; + }, { + id: string; + title: string; + }>; + }, "strip", z.ZodTypeAny, { + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + }, { + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + }>, z.ZodObject<{ + type: z.ZodLiteral; + list_reply: z.ZodObject<{ + id: z.ZodString; + title: z.ZodString; + description: z.ZodString; + }, "strip", z.ZodTypeAny, { + id: string; + title: string; + description: string; + }, { + id: string; + title: string; + description: string; + }>; + }, "strip", z.ZodTypeAny, { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }, { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }>]>>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); + }, { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Unknown; + }, { + type: NotificationMessageTypeEnum.Unknown; + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + location: z.ZodObject<{ + latitude: z.ZodNumber; + longitude: z.ZodNumber; + name: z.ZodOptional; + address: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }, { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; + }, { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + reaction: z.ZodObject<{ + message_id: z.ZodString; + emoji: z.ZodString; + }, "strip", z.ZodTypeAny, { + message_id: string; + emoji: string; + }, { + message_id: string; + emoji: string; + }>; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; + }, { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; + }>]>, z.ZodObject<{ + type: z.ZodLiteral; + contacts: z.ZodArray, "many">; + }, "strip", z.ZodTypeAny, { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; + }, { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; + }>]>>, "many">>; + errors: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }, { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }>, "many">>; + }, "strip", z.ZodTypeAny, { + messaging_product: string; + metadata: { + display_phone_number: string; + phone_number_id: string; + }; + messages?: ({ + type: NotificationMessageTypeEnum; + id: string; + from: string; + timestamp: string; + context?: { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + } & ({ + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; + } | { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; + } | { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; + } | { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; + } | { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; + } | { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; + } | { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; + } | { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); + } | { + type: NotificationMessageTypeEnum.Unknown; + } | { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; + }))[] | undefined; + contacts?: { + wa_id: string; + profile: { + name: string; + }; + }[] | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + statuses?: { + status: MessageStatusEnum; + timestamp: string; + recipient_id: string; + conversation?: { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + pricing?: { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + } | undefined; + }[] | undefined; + }, { + messaging_product: string; + metadata: { + display_phone_number: string; + phone_number_id: string; + }; + messages?: ({ + type: NotificationMessageTypeEnum; + id: string; + from: string; + timestamp: string; + context?: { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + } & ({ + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; + } | { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; + } | { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; + } | { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; + } | { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; + } | { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; + } | { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; + } | { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); + } | { + type: NotificationMessageTypeEnum.Unknown; + } | { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; + }))[] | undefined; + contacts?: { + wa_id: string; + profile: { + name: string; + }; + }[] | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + statuses?: { + status: MessageStatusEnum; + timestamp: string; + recipient_id: string; + conversation?: { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + pricing?: { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + } | undefined; + }[] | undefined; + }>; + field: z.ZodLiteral<"messages">; + }, "strip", z.ZodTypeAny, { + value: { + messaging_product: string; + metadata: { + display_phone_number: string; + phone_number_id: string; + }; + messages?: ({ + type: NotificationMessageTypeEnum; + id: string; + from: string; + timestamp: string; + context?: { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + } & ({ + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; + } | { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; + } | { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; + } | { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; + } | { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; + } | { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; + } | { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; + } | { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); + } | { + type: NotificationMessageTypeEnum.Unknown; + } | { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; + }))[] | undefined; + contacts?: { + wa_id: string; + profile: { + name: string; + }; + }[] | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + statuses?: { + status: MessageStatusEnum; + timestamp: string; + recipient_id: string; + conversation?: { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + pricing?: { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + } | undefined; + }[] | undefined; + }; + field: "messages"; + }, { + value: { + messaging_product: string; + metadata: { + display_phone_number: string; + phone_number_id: string; + }; + messages?: ({ + type: NotificationMessageTypeEnum; + id: string; + from: string; + timestamp: string; + context?: { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + } & ({ + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; + } | { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; + } | { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; + } | { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; + } | { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; + } | { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; + } | { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; + } | { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); + } | { + type: NotificationMessageTypeEnum.Unknown; + } | { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; + }))[] | undefined; + contacts?: { + wa_id: string; + profile: { + name: string; + }; + }[] | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + statuses?: { + status: MessageStatusEnum; + timestamp: string; + recipient_id: string; + conversation?: { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + pricing?: { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + } | undefined; + }[] | undefined; + }; + field: "messages"; + }>, "many">; + }, "strip", z.ZodTypeAny, { + id: string; + changes: { + value: { + messaging_product: string; + metadata: { + display_phone_number: string; + phone_number_id: string; + }; + messages?: ({ + type: NotificationMessageTypeEnum; + id: string; + from: string; + timestamp: string; + context?: { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + } & ({ + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; + } | { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; + } | { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; + } | { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; + } | { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; + } | { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; + } | { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; + } | { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); + } | { + type: NotificationMessageTypeEnum.Unknown; + } | { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; + }))[] | undefined; + contacts?: { + wa_id: string; + profile: { + name: string; + }; + }[] | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + statuses?: { + status: MessageStatusEnum; + timestamp: string; + recipient_id: string; + conversation?: { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + pricing?: { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + } | undefined; + }[] | undefined; + }; + field: "messages"; + }[]; + }, { + id: string; + changes: { + value: { + messaging_product: string; + metadata: { + display_phone_number: string; + phone_number_id: string; + }; + messages?: ({ + type: NotificationMessageTypeEnum; + id: string; + from: string; + timestamp: string; + context?: { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + } & ({ + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; + } | { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; + } | { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; + } | { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; + } | { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; + } | { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; + } | { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; + } | { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); + } | { + type: NotificationMessageTypeEnum.Unknown; + } | { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; + }))[] | undefined; + contacts?: { + wa_id: string; + profile: { + name: string; + }; + }[] | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + statuses?: { + status: MessageStatusEnum; + timestamp: string; + recipient_id: string; + conversation?: { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + pricing?: { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + } | undefined; + }[] | undefined; + }; + field: "messages"; + }[]; + }>, "many">; +}, "strip", z.ZodTypeAny, { + object: string; + entry: { + id: string; + changes: { + value: { + messaging_product: string; + metadata: { + display_phone_number: string; + phone_number_id: string; + }; + messages?: ({ + type: NotificationMessageTypeEnum; + id: string; + from: string; + timestamp: string; + context?: { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + } & ({ + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; + } | { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; + } | { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; + } | { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; + } | { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; + } | { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; + } | { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; + } | { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); + } | { + type: NotificationMessageTypeEnum.Unknown; + } | { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; + }))[] | undefined; + contacts?: { + wa_id: string; + profile: { + name: string; + }; + }[] | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + statuses?: { + status: MessageStatusEnum; + timestamp: string; + recipient_id: string; + conversation?: { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + pricing?: { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + } | undefined; + }[] | undefined; + }; + field: "messages"; + }[]; + }[]; +}, { + object: string; + entry: { + id: string; + changes: { + value: { + messaging_product: string; + metadata: { + display_phone_number: string; + phone_number_id: string; + }; + messages?: ({ + type: NotificationMessageTypeEnum; + id: string; + from: string; + timestamp: string; + context?: { + id: string; + forwarded?: boolean | undefined; + frequently_forwarded?: boolean | undefined; + from?: string | undefined; + referred_product?: { + product_retailer_id: string; + catalog_id: string; + } | undefined; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + } & ({ + type: NotificationMessageTypeEnum.Text; + text: { + body: string; + }; + referral?: { + body: string; + source_url: string; + source_type: AdInteractionSourceTypeEnum; + source_id: string; + headline: string; + thumbnail_url: string; + ctwa_clid: string; + media_type: AdInteractionSourceMediaTypeEnum; + image_url?: string | undefined; + video_url?: string | undefined; + } | undefined; + } | { + type: NotificationMessageTypeEnum.Audio; + audio: { + id: string; + mime_type: string; + sha256: string; + }; + } | { + type: NotificationMessageTypeEnum.Image; + image: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Button; + button: { + text: string; + payload: string; + }; + } | { + type: NotificationMessageTypeEnum.Document; + document: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Order; + text: string; + order: { + product_items: { + currency: string; + product_retailer_id: string; + quantity: string; + item_price: string; + }[]; + catalog_id: string; + }; + } | { + type: NotificationMessageTypeEnum.Sticker; + sticker: { + id: string; + mime_type: string; + sha256: string; + animated: boolean; + }; + } | { + type: NotificationMessageTypeEnum.System; + system: { + type: SystemNotificationTypeEnum; + wa_id: string; + body: string; + identity: string; + customer: string; + }; + identity: { + acknowledged: string; + created_timestamp: string; + hash: string; + }; + } | { + type: NotificationMessageTypeEnum.Video; + video: { + id: string; + mime_type: string; + sha256: string; + caption?: string | undefined; + filename?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Reaction; + reaction: { + message_id: string; + emoji: string; + }; + } | { + type: NotificationMessageTypeEnum.Interactive; + interactive: { + type: InteractionNotificationTypeEnum; + } & ({ + type: InteractionNotificationTypeEnum.ButtonReply; + button_reply: { + id: string; + title: string; + }; + } | { + type: InteractionNotificationTypeEnum.ListReply; + list_reply: { + id: string; + title: string; + description: string; + }; + }); + } | { + type: NotificationMessageTypeEnum.Unknown; + } | { + type: NotificationMessageTypeEnum.Location; + location: { + latitude: number; + longitude: number; + name?: string | undefined; + address?: string | undefined; + }; + } | { + type: NotificationMessageTypeEnum.Contacts; + contacts: Contact[]; + }))[] | undefined; + contacts?: { + wa_id: string; + profile: { + name: string; + }; + }[] | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + statuses?: { + status: MessageStatusEnum; + timestamp: string; + recipient_id: string; + conversation?: { + id: string; + origin: { + type: MessageStatusCategoryEnum; + expiration_timestamp?: string | null | undefined; + }; + } | undefined; + errors?: { + code: number; + message: string; + error_data: { + details: string; + }; + title: string; + }[] | undefined; + pricing?: { + pricing_model: "CBP"; + category: MessageStatusCategoryEnum; + } | undefined; + }[] | undefined; + }; + field: "messages"; + }[]; + }[]; +}>; + +// Warnings were encountered during analysis: +// +// dist/esm/index.d.ts:370:9 - (ae-forgotten-export) The symbol "ButtonInteractiveMessagePayload" needs to be exported by the entry point index.d.ts +// dist/esm/index.d.ts:4539:9 - (ae-forgotten-export) The symbol "ListInteractiveMessageSection" needs to be exported by the entry point index.d.ts +// dist/esm/index.d.ts:4584:9 - (ae-forgotten-export) The symbol "ListInteractiveMessagePayload" needs to be exported by the entry point index.d.ts +// dist/esm/index.d.ts:6655:9 - (ae-forgotten-export) The symbol "ProductInteractiveMessagePayload" needs to be exported by the entry point index.d.ts +// dist/esm/index.d.ts:7000:9 - (ae-forgotten-export) The symbol "ProductListInteractiveMessageSection" needs to be exported by the entry point index.d.ts +// dist/esm/index.d.ts:7022:9 - (ae-forgotten-export) The symbol "InteractiveMessageHeaderSchemaType" needs to be exported by the entry point index.d.ts +// dist/esm/index.d.ts:7047:9 - (ae-forgotten-export) The symbol "ProductListInteractiveMessagePayload" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/wapi.js/tsdoc.json b/packages/wapi.js/tsdoc.json new file mode 100644 index 0000000..f5a4dc6 --- /dev/null +++ b/packages/wapi.js/tsdoc.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", + "extends": ["../../tsdoc.json"] +} diff --git a/patches/@microsoft__tsdoc-config@0.16.2.patch b/patches/@microsoft__tsdoc-config@0.16.2.patch new file mode 100644 index 0000000..96650a3 --- /dev/null +++ b/patches/@microsoft__tsdoc-config@0.16.2.patch @@ -0,0 +1,1459 @@ +diff --git a/lib/TSDocConfigFile.js b/lib/TSDocConfigFile.js +index caf3515d60fd386c5909db5a0aa8b4180b10d602..9b4c3134e094d60af9c3aa95c8feee72ff21a245 100644 +--- a/lib/TSDocConfigFile.js ++++ b/lib/TSDocConfigFile.js +@@ -1,26 +1,46 @@ + "use strict"; +-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { +- if (k2 === undefined) k2 = k; +- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +-}) : (function(o, m, k, k2) { +- if (k2 === undefined) k2 = k; +- o[k2] = m[k]; +-})); +-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { +- Object.defineProperty(o, "default", { enumerable: true, value: v }); +-}) : function(o, v) { +- o["default"] = v; +-}); +-var __importStar = (this && this.__importStar) || function (mod) { ++var __createBinding = ++ (this && this.__createBinding) || ++ (Object.create ++ ? function (o, m, k, k2) { ++ if (k2 === undefined) k2 = k; ++ Object.defineProperty(o, k2, { ++ enumerable: true, ++ get: function () { ++ return m[k]; ++ }, ++ }); ++ } ++ : function (o, m, k, k2) { ++ if (k2 === undefined) k2 = k; ++ o[k2] = m[k]; ++ }); ++var __setModuleDefault = ++ (this && this.__setModuleDefault) || ++ (Object.create ++ ? function (o, v) { ++ Object.defineProperty(o, "default", { enumerable: true, value: v }); ++ } ++ : function (o, v) { ++ o["default"] = v; ++ }); ++var __importStar = ++ (this && this.__importStar) || ++ function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; +- if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); ++ if (mod != null) ++ for (var k in mod) ++ if (k !== "default" && Object.hasOwnProperty.call(mod, k)) ++ __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +-}; +-var __importDefault = (this && this.__importDefault) || function (mod) { +- return (mod && mod.__esModule) ? mod : { "default": mod }; +-}; ++ }; ++var __importDefault = ++ (this && this.__importDefault) || ++ function (mod) { ++ return mod && mod.__esModule ? mod : { default: mod }; ++ }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TSDocConfigFile = void 0; + const tsdoc_1 = require("@microsoft/tsdoc"); +@@ -31,10 +51,101 @@ const ajv_1 = __importDefault(require("ajv")); + const jju = __importStar(require("jju")); + const ajv = new ajv_1.default({ verbose: true }); + function initializeSchemaValidator() { +- const jsonSchemaPath = resolve.sync('@microsoft/tsdoc/schemas/tsdoc.schema.json', { basedir: __dirname }); +- const jsonSchemaContent = fs.readFileSync(jsonSchemaPath).toString(); +- const jsonSchema = jju.parse(jsonSchemaContent, { mode: 'cjson' }); +- return ajv.compile(jsonSchema); ++ const jsonSchemaContent = JSON.stringify({ ++ title: "TSDoc Configuration", ++ description: "Describes the TSDoc configuration for a TypeScript project", ++ type: "object", ++ properties: { ++ $schema: { ++ description: ++ "Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.", ++ type: "string", ++ }, ++ ++ extends: { ++ description: ++ 'Optionally specifies one or more JSON config files that will be combined with this file. This provides a way for standard settings to be shared across multiple projects. Important: The "extends" paths are resolved using NodeJS module resolution, so a path to a local file MUST be prefixed with "./".', ++ type: "array", ++ items: { ++ type: "string", ++ }, ++ }, ++ ++ noStandardTags: { ++ description: ++ 'By default, the config file loader will predefine all of the standardized TSDoc tags. To disable this and start with a completely empty configuration, set "noStandardTags"=true.', ++ type: "boolean", ++ }, ++ ++ tagDefinitions: { ++ description: ++ "Additional tags to support when parsing documentation comments with TSDoc.", ++ type: "array", ++ items: { ++ $ref: "#/definitions/tsdocTagDefinition", ++ }, ++ }, ++ ++ supportedHtmlElements: { ++ description: ++ 'The HTML element names that are supported in this configuration. Used in conjunction with the "reportUnsupportedHtmlElements" setting.', ++ type: "array", ++ items: { ++ type: "string", ++ pattern: "^[a-zA-Z0-9-]+$", ++ }, ++ }, ++ ++ reportUnsupportedHtmlElements: { ++ description: ++ 'Whether an error should be reported when an unsupported HTML element is encountered in a doc comment. Defaults to "true" if the "supportedHtmlElements" field is present in this file, "false" if not.', ++ type: "boolean", ++ }, ++ ++ supportForTags: { ++ description: ++ 'A collection of key/value pairs. The key is a TSDoc tag name (e.g. "@myTag") that must be defined in this configuration. The value is a boolean indicating whether the tag is supported. The TSDoc parser may report warnings when unsupported tags are encountered. If "supportForTags" is specified for at least one tag, then the "reportUnsupportedTags" validation check is enabled by default.', ++ type: "object", ++ patternProperties: { ++ "@[a-zA-Z][a-zA-Z0-9]*$": { ++ type: "boolean", ++ }, ++ }, ++ additionalItems: false, ++ }, ++ }, ++ required: ["$schema"], ++ additionalProperties: false, ++ ++ definitions: { ++ tsdocTagDefinition: { ++ description: "Configuration for a custom supported TSDoc tag.", ++ type: "object", ++ properties: { ++ tagName: { ++ description: ++ "Name of the custom tag. TSDoc tag names start with an at-sign (@) followed by ASCII letters using camelCase capitalization.", ++ type: "string", ++ }, ++ syntaxKind: { ++ description: ++ 'Syntax kind of the custom tag. "inline" means that this tag can appear inside other documentation sections (example: {@link}). "block" means that this tag starts a new documentation section (example: @remarks). "modifier" means that this tag\'s presence indicates an aspect of the associated API item (example: @internal).', ++ type: "string", ++ enum: ["inline", "block", "modifier"], ++ }, ++ allowMultiple: { ++ description: ++ "If true, then this tag may appear multiple times in a doc comment. By default, a tag may only appear once.", ++ type: "boolean", ++ }, ++ }, ++ required: ["tagName", "syntaxKind"], ++ additionalProperties: false, ++ }, ++ }, ++ }); ++ const jsonSchema = jju.parse(jsonSchemaContent, { mode: "cjson" }); ++ return ajv.compile(jsonSchema); + } + // Warning: AJV has a fairly strange API. Each time this function is called, the function object's + // properties get overwritten with the results of the latest validation. Thus we need to be careful +@@ -46,638 +157,656 @@ const tsdocSchemaValidator = initializeSchemaValidator(); + * @public + */ + class TSDocConfigFile { +- constructor() { +- this.log = new tsdoc_1.ParserMessageLog(); +- this._extendsFiles = []; +- this._filePath = ''; +- this._fileNotFound = false; +- this._hasErrors = false; +- this._fileMTime = 0; +- this._tsdocSchema = ''; +- this._extendsPaths = []; +- this._noStandardTags = undefined; +- this._tagDefinitions = []; +- this._tagDefinitionNames = new Set(); +- this._supportForTags = new Map(); +- } +- /** +- * Other config files that this file extends from. +- */ +- get extendsFiles() { +- return this._extendsFiles; +- } +- /** +- * The full path of the file that was attempted to load, or an empty string if the configuration was +- * loaded from a source that is not a file. +- */ +- get filePath() { +- return this._filePath; +- } +- /** +- * If true, then the TSDocConfigFile object contains an empty state, because the `tsdoc.json` file +- * was not found by the loader. +- * +- * @remarks +- * A missing "tsdoc.json" file is not considered an error. It simply means that the defaults will be used. +- */ +- get fileNotFound() { +- return this._fileNotFound; +- } +- /** +- * If true, then at least one error was encountered while loading this file or one of its "extends" files. +- * +- * @remarks +- * You can use {@link TSDocConfigFile.getErrorSummary} to report these errors. +- * +- * The individual messages can be retrieved from the {@link TSDocConfigFile.log} property of each `TSDocConfigFile` +- * object (including the {@link TSDocConfigFile.extendsFiles} tree). +- */ +- get hasErrors() { +- return this._hasErrors; +- } +- /** +- * The `$schema` field from the `tsdoc.json` file. +- */ +- get tsdocSchema() { +- return this._tsdocSchema; +- } +- /** +- * The `extends` field from the `tsdoc.json` file. For the parsed file contents, +- * use the `extendsFiles` property instead. +- */ +- get extendsPaths() { +- return this._extendsPaths; +- } +- /** +- * By default, the config file loader will predefine all of the standardized TSDoc tags. To disable this and +- * start with a completely empty configuration, set `noStandardTags` to true. +- * +- * @remarks +- * If a config file uses `"extends"` to include settings from base config files, then its setting will +- * override any settings from the base config files. If `"noStandardTags"` is not specified, then this +- * property will be `undefined`. The config files are applied in the order they are processed (a depth-first +- * traversal of the `"extends"` references), and files processed later can override earlier files. +- * If no config file specifies `noStandardTags` then the default value is `false`. +- */ +- get noStandardTags() { +- return this._noStandardTags; +- } +- set noStandardTags(value) { +- this._noStandardTags = value; +- } +- get tagDefinitions() { +- return this._tagDefinitions; +- } +- get supportForTags() { +- return this._supportForTags; +- } +- get supportedHtmlElements() { +- return this._supportedHtmlElements && Array.from(this._supportedHtmlElements); +- } +- get reportUnsupportedHtmlElements() { +- return this._reportUnsupportedHtmlElements; +- } +- set reportUnsupportedHtmlElements(value) { +- this._reportUnsupportedHtmlElements = value; +- } +- /** +- * Removes all items from the `tagDefinitions` array. +- */ +- clearTagDefinitions() { +- this._tagDefinitions.length = 0; +- this._tagDefinitionNames.clear(); +- } +- /** +- * Adds a new item to the `tagDefinitions` array. +- */ +- addTagDefinition(parameters) { +- // This validates the tag name +- const tagDefinition = new tsdoc_1.TSDocTagDefinition(parameters); +- if (this._tagDefinitionNames.has(tagDefinition.tagNameWithUpperCase)) { +- throw new Error(`A tag definition was already added with the tag name "${parameters.tagName}"`); +- } +- this._tagDefinitionNames.add(tagDefinition.tagName); +- this._tagDefinitions.push(tagDefinition); +- } +- // Similar to addTagDefinition() but reports errors using _reportError() +- _addTagDefinitionForLoad(parameters) { +- let tagDefinition; +- try { +- // This validates the tag name +- tagDefinition = new tsdoc_1.TSDocTagDefinition(parameters); +- } +- catch (error) { +- this._reportError({ +- messageId: tsdoc_1.TSDocMessageId.ConfigFileInvalidTagName, +- messageText: error.message, +- textRange: tsdoc_1.TextRange.empty, +- }); +- return; +- } +- if (this._tagDefinitionNames.has(tagDefinition.tagNameWithUpperCase)) { +- this._reportError({ +- messageId: tsdoc_1.TSDocMessageId.ConfigFileDuplicateTagName, +- messageText: `The "tagDefinitions" field specifies more than one tag with the name "${parameters.tagName}"`, +- textRange: tsdoc_1.TextRange.empty, +- }); +- } +- this._tagDefinitionNames.add(tagDefinition.tagNameWithUpperCase); +- this._tagDefinitions.push(tagDefinition); +- } +- /** +- * Adds a new item to the `supportedHtmlElements` array. +- */ +- addSupportedHtmlElement(htmlElement) { +- if (!this._supportedHtmlElements) { +- this._supportedHtmlElements = new Set(); +- } +- this._supportedHtmlElements.add(htmlElement); +- } +- /** +- * Removes the explicit list of allowed html elements. +- */ +- clearSupportedHtmlElements() { +- this._supportedHtmlElements = undefined; +- } +- /** +- * Removes all entries from the "supportForTags" map. +- */ +- clearSupportForTags() { +- this._supportForTags.clear(); +- } +- /** +- * Sets an entry in the "supportForTags" map. +- */ +- setSupportForTag(tagName, supported) { +- tsdoc_1.TSDocTagDefinition.validateTSDocTagName(tagName); ++ constructor() { ++ this.log = new tsdoc_1.ParserMessageLog(); ++ this._extendsFiles = []; ++ this._filePath = ""; ++ this._fileNotFound = false; ++ this._hasErrors = false; ++ this._fileMTime = 0; ++ this._tsdocSchema = ""; ++ this._extendsPaths = []; ++ this._noStandardTags = undefined; ++ this._tagDefinitions = []; ++ this._tagDefinitionNames = new Set(); ++ this._supportForTags = new Map(); ++ } ++ /** ++ * Other config files that this file extends from. ++ */ ++ get extendsFiles() { ++ return this._extendsFiles; ++ } ++ /** ++ * The full path of the file that was attempted to load, or an empty string if the configuration was ++ * loaded from a source that is not a file. ++ */ ++ get filePath() { ++ return this._filePath; ++ } ++ /** ++ * If true, then the TSDocConfigFile object contains an empty state, because the `tsdoc.json` file ++ * was not found by the loader. ++ * ++ * @remarks ++ * A missing "tsdoc.json" file is not considered an error. It simply means that the defaults will be used. ++ */ ++ get fileNotFound() { ++ return this._fileNotFound; ++ } ++ /** ++ * If true, then at least one error was encountered while loading this file or one of its "extends" files. ++ * ++ * @remarks ++ * You can use {@link TSDocConfigFile.getErrorSummary} to report these errors. ++ * ++ * The individual messages can be retrieved from the {@link TSDocConfigFile.log} property of each `TSDocConfigFile` ++ * object (including the {@link TSDocConfigFile.extendsFiles} tree). ++ */ ++ get hasErrors() { ++ return this._hasErrors; ++ } ++ /** ++ * The `$schema` field from the `tsdoc.json` file. ++ */ ++ get tsdocSchema() { ++ return this._tsdocSchema; ++ } ++ /** ++ * The `extends` field from the `tsdoc.json` file. For the parsed file contents, ++ * use the `extendsFiles` property instead. ++ */ ++ get extendsPaths() { ++ return this._extendsPaths; ++ } ++ /** ++ * By default, the config file loader will predefine all of the standardized TSDoc tags. To disable this and ++ * start with a completely empty configuration, set `noStandardTags` to true. ++ * ++ * @remarks ++ * If a config file uses `"extends"` to include settings from base config files, then its setting will ++ * override any settings from the base config files. If `"noStandardTags"` is not specified, then this ++ * property will be `undefined`. The config files are applied in the order they are processed (a depth-first ++ * traversal of the `"extends"` references), and files processed later can override earlier files. ++ * If no config file specifies `noStandardTags` then the default value is `false`. ++ */ ++ get noStandardTags() { ++ return this._noStandardTags; ++ } ++ set noStandardTags(value) { ++ this._noStandardTags = value; ++ } ++ get tagDefinitions() { ++ return this._tagDefinitions; ++ } ++ get supportForTags() { ++ return this._supportForTags; ++ } ++ get supportedHtmlElements() { ++ return ( ++ this._supportedHtmlElements && Array.from(this._supportedHtmlElements) ++ ); ++ } ++ get reportUnsupportedHtmlElements() { ++ return this._reportUnsupportedHtmlElements; ++ } ++ set reportUnsupportedHtmlElements(value) { ++ this._reportUnsupportedHtmlElements = value; ++ } ++ /** ++ * Removes all items from the `tagDefinitions` array. ++ */ ++ clearTagDefinitions() { ++ this._tagDefinitions.length = 0; ++ this._tagDefinitionNames.clear(); ++ } ++ /** ++ * Adds a new item to the `tagDefinitions` array. ++ */ ++ addTagDefinition(parameters) { ++ // This validates the tag name ++ const tagDefinition = new tsdoc_1.TSDocTagDefinition(parameters); ++ if (this._tagDefinitionNames.has(tagDefinition.tagNameWithUpperCase)) { ++ throw new Error( ++ `A tag definition was already added with the tag name "${parameters.tagName}"` ++ ); ++ } ++ this._tagDefinitionNames.add(tagDefinition.tagName); ++ this._tagDefinitions.push(tagDefinition); ++ } ++ // Similar to addTagDefinition() but reports errors using _reportError() ++ _addTagDefinitionForLoad(parameters) { ++ let tagDefinition; ++ try { ++ // This validates the tag name ++ tagDefinition = new tsdoc_1.TSDocTagDefinition(parameters); ++ } catch (error) { ++ this._reportError({ ++ messageId: tsdoc_1.TSDocMessageId.ConfigFileInvalidTagName, ++ messageText: error.message, ++ textRange: tsdoc_1.TextRange.empty, ++ }); ++ return; ++ } ++ if (this._tagDefinitionNames.has(tagDefinition.tagNameWithUpperCase)) { ++ this._reportError({ ++ messageId: tsdoc_1.TSDocMessageId.ConfigFileDuplicateTagName, ++ messageText: `The "tagDefinitions" field specifies more than one tag with the name "${parameters.tagName}"`, ++ textRange: tsdoc_1.TextRange.empty, ++ }); ++ } ++ this._tagDefinitionNames.add(tagDefinition.tagNameWithUpperCase); ++ this._tagDefinitions.push(tagDefinition); ++ } ++ /** ++ * Adds a new item to the `supportedHtmlElements` array. ++ */ ++ addSupportedHtmlElement(htmlElement) { ++ if (!this._supportedHtmlElements) { ++ this._supportedHtmlElements = new Set(); ++ } ++ this._supportedHtmlElements.add(htmlElement); ++ } ++ /** ++ * Removes the explicit list of allowed html elements. ++ */ ++ clearSupportedHtmlElements() { ++ this._supportedHtmlElements = undefined; ++ } ++ /** ++ * Removes all entries from the "supportForTags" map. ++ */ ++ clearSupportForTags() { ++ this._supportForTags.clear(); ++ } ++ /** ++ * Sets an entry in the "supportForTags" map. ++ */ ++ setSupportForTag(tagName, supported) { ++ tsdoc_1.TSDocTagDefinition.validateTSDocTagName(tagName); ++ this._supportForTags.set(tagName, supported); ++ } ++ /** ++ * This can be used for cache eviction. It returns true if the modification timestamp has changed for ++ * any of the files that were read when loading this `TSDocConfigFile`, which indicates that the file should be ++ * reloaded. It does not consider cases where `TSDocConfigFile.fileNotFound` was `true`. ++ * ++ * @remarks ++ * This can be used for cache eviction. An example eviction strategy might be like this: ++ * ++ * - call `checkForModifiedFiles()` once per second, and reload the configuration if it returns true ++ * ++ * - otherwise, reload the configuration when it is more than 10 seconds old (to handle less common cases such ++ * as creation of a missing file, or creation of a file at an earlier location in the search path). ++ */ ++ checkForModifiedFiles() { ++ if (this._checkForModifiedFile()) { ++ return true; ++ } ++ for (const extendsFile of this.extendsFiles) { ++ if (extendsFile.checkForModifiedFiles()) { ++ return true; ++ } ++ } ++ return false; ++ } ++ /** ++ * Checks the last modification time for `TSDocConfigFile.filePath` and returns `true` if it has changed ++ * since the file was loaded. If the file is missing, this returns `false`. If the timestamp cannot be read, ++ * then this returns `true`. ++ */ ++ _checkForModifiedFile() { ++ if (this._fileNotFound || !this._filePath) { ++ return false; ++ } ++ try { ++ const mtimeMs = fs.statSync(this._filePath).mtimeMs; ++ return mtimeMs !== this._fileMTime; ++ } catch (error) { ++ return true; ++ } ++ } ++ _reportError(parserMessageParameters) { ++ this.log.addMessage(new tsdoc_1.ParserMessage(parserMessageParameters)); ++ this._hasErrors = true; ++ } ++ _loadJsonObject(configJson) { ++ if (configJson.$schema !== TSDocConfigFile.CURRENT_SCHEMA_URL) { ++ this._reportError({ ++ messageId: tsdoc_1.TSDocMessageId.ConfigFileUnsupportedSchema, ++ messageText: `Unsupported JSON "$schema" value; expecting "${TSDocConfigFile.CURRENT_SCHEMA_URL}"`, ++ textRange: tsdoc_1.TextRange.empty, ++ }); ++ return; ++ } ++ const success = tsdocSchemaValidator(configJson); ++ if (!success) { ++ const description = ajv.errorsText(tsdocSchemaValidator.errors); ++ this._reportError({ ++ messageId: tsdoc_1.TSDocMessageId.ConfigFileSchemaError, ++ messageText: "Error loading config file: " + description, ++ textRange: tsdoc_1.TextRange.empty, ++ }); ++ return; ++ } ++ this._tsdocSchema = configJson.$schema; ++ if (configJson.extends) { ++ this._extendsPaths.push(...configJson.extends); ++ } ++ this.noStandardTags = configJson.noStandardTags; ++ for (const jsonTagDefinition of configJson.tagDefinitions || []) { ++ let syntaxKind; ++ switch (jsonTagDefinition.syntaxKind) { ++ case "inline": ++ syntaxKind = tsdoc_1.TSDocTagSyntaxKind.InlineTag; ++ break; ++ case "block": ++ syntaxKind = tsdoc_1.TSDocTagSyntaxKind.BlockTag; ++ break; ++ case "modifier": ++ syntaxKind = tsdoc_1.TSDocTagSyntaxKind.ModifierTag; ++ break; ++ default: ++ // The JSON schema should have caught this error ++ throw new Error("Unexpected tag kind"); ++ } ++ this._addTagDefinitionForLoad({ ++ tagName: jsonTagDefinition.tagName, ++ syntaxKind: syntaxKind, ++ allowMultiple: jsonTagDefinition.allowMultiple, ++ }); ++ } ++ if (configJson.supportedHtmlElements) { ++ this._supportedHtmlElements = new Set(); ++ for (const htmlElement of configJson.supportedHtmlElements) { ++ this.addSupportedHtmlElement(htmlElement); ++ } ++ } ++ this._reportUnsupportedHtmlElements = ++ configJson.reportUnsupportedHtmlElements; ++ if (configJson.supportForTags) { ++ for (const tagName of Object.keys(configJson.supportForTags)) { ++ const supported = configJson.supportForTags[tagName]; + this._supportForTags.set(tagName, supported); +- } +- /** +- * This can be used for cache eviction. It returns true if the modification timestamp has changed for +- * any of the files that were read when loading this `TSDocConfigFile`, which indicates that the file should be +- * reloaded. It does not consider cases where `TSDocConfigFile.fileNotFound` was `true`. +- * +- * @remarks +- * This can be used for cache eviction. An example eviction strategy might be like this: +- * +- * - call `checkForModifiedFiles()` once per second, and reload the configuration if it returns true +- * +- * - otherwise, reload the configuration when it is more than 10 seconds old (to handle less common cases such +- * as creation of a missing file, or creation of a file at an earlier location in the search path). +- */ +- checkForModifiedFiles() { +- if (this._checkForModifiedFile()) { +- return true; +- } +- for (const extendsFile of this.extendsFiles) { +- if (extendsFile.checkForModifiedFiles()) { +- return true; +- } +- } +- return false; +- } +- /** +- * Checks the last modification time for `TSDocConfigFile.filePath` and returns `true` if it has changed +- * since the file was loaded. If the file is missing, this returns `false`. If the timestamp cannot be read, +- * then this returns `true`. +- */ +- _checkForModifiedFile() { +- if (this._fileNotFound || !this._filePath) { +- return false; +- } +- try { +- const mtimeMs = fs.statSync(this._filePath).mtimeMs; +- return mtimeMs !== this._fileMTime; +- } +- catch (error) { +- return true; +- } +- } +- _reportError(parserMessageParameters) { +- this.log.addMessage(new tsdoc_1.ParserMessage(parserMessageParameters)); ++ } ++ } ++ } ++ _loadWithExtends(configFilePath, referencingConfigFile, alreadyVisitedPaths) { ++ // In case an exception is thrown, start by assuming that the file was not found; we'll revise ++ // this later upon success ++ this._fileNotFound = true; ++ if (!configFilePath) { ++ this._reportError({ ++ messageId: tsdoc_1.TSDocMessageId.ConfigFileNotFound, ++ messageText: "File not found", ++ textRange: tsdoc_1.TextRange.empty, ++ }); ++ return; ++ } ++ this._filePath = path.resolve(configFilePath); ++ if (!fs.existsSync(this._filePath)) { ++ this._reportError({ ++ messageId: tsdoc_1.TSDocMessageId.ConfigFileNotFound, ++ messageText: "File not found", ++ textRange: tsdoc_1.TextRange.empty, ++ }); ++ return; ++ } ++ const configJsonContent = fs.readFileSync(this._filePath).toString(); ++ this._fileMTime = fs.statSync(this._filePath).mtimeMs; ++ this._fileNotFound = false; ++ const hashKey = fs.realpathSync(this._filePath); ++ if (referencingConfigFile && alreadyVisitedPaths.has(hashKey)) { ++ this._reportError({ ++ messageId: tsdoc_1.TSDocMessageId.ConfigFileCyclicExtends, ++ messageText: `Circular reference encountered for "extends" field of "${referencingConfigFile.filePath}"`, ++ textRange: tsdoc_1.TextRange.empty, ++ }); ++ return; ++ } ++ alreadyVisitedPaths.add(hashKey); ++ let configJson; ++ try { ++ configJson = jju.parse(configJsonContent, { mode: "cjson" }); ++ } catch (e) { ++ this._reportError({ ++ messageId: tsdoc_1.TSDocMessageId.ConfigInvalidJson, ++ messageText: "Error parsing JSON input: " + e.message, ++ textRange: tsdoc_1.TextRange.empty, ++ }); ++ return; ++ } ++ this._loadJsonObject(configJson); ++ const configFileFolder = path.dirname(this.filePath); ++ for (const extendsField of this.extendsPaths) { ++ let resolvedExtendsPath; ++ try { ++ resolvedExtendsPath = resolve.sync(extendsField, { ++ basedir: configFileFolder, ++ }); ++ } catch (e) { ++ this._reportError({ ++ messageId: tsdoc_1.TSDocMessageId.ConfigFileUnresolvedExtends, ++ messageText: ++ `Unable to resolve "extends" reference to "${extendsField}": ` + ++ e.message, ++ textRange: tsdoc_1.TextRange.empty, ++ }); ++ return; ++ } ++ const baseConfigFile = new TSDocConfigFile(); ++ baseConfigFile._loadWithExtends( ++ resolvedExtendsPath, ++ this, ++ alreadyVisitedPaths ++ ); ++ if (baseConfigFile.fileNotFound) { ++ this._reportError({ ++ messageId: tsdoc_1.TSDocMessageId.ConfigFileUnresolvedExtends, ++ messageText: `Unable to resolve "extends" reference to "${extendsField}"`, ++ textRange: tsdoc_1.TextRange.empty, ++ }); ++ } ++ this._extendsFiles.push(baseConfigFile); ++ if (baseConfigFile.hasErrors) { + this._hasErrors = true; ++ } ++ } ++ } ++ /** ++ * For the given folder, look for the relevant tsdoc.json file (if any), and return its path. ++ * ++ * @param folderPath - the path to a folder where the search should start ++ * @returns the (possibly relative) path to tsdoc.json, or an empty string if not found ++ */ ++ static findConfigPathForFolder(folderPath) { ++ if (folderPath) { ++ let foundFolder = folderPath; ++ for (;;) { ++ const tsconfigJsonPath = path.join(foundFolder, "tsconfig.json"); ++ if (fs.existsSync(tsconfigJsonPath)) { ++ // Stop when we reach a folder containing tsconfig.json ++ return path.join(foundFolder, TSDocConfigFile.FILENAME); ++ } ++ const packageJsonPath = path.join(foundFolder, "package.json"); ++ if (fs.existsSync(packageJsonPath)) { ++ // Stop when we reach a folder containing package.json; this avoids crawling out of the current package ++ return path.join(foundFolder, TSDocConfigFile.FILENAME); ++ } ++ const previousFolder = foundFolder; ++ foundFolder = path.dirname(foundFolder); ++ if (!foundFolder || foundFolder === previousFolder) { ++ // Give up if we reach the filesystem root directory ++ break; ++ } ++ } ++ } ++ return ""; ++ } ++ /** ++ * Calls `TSDocConfigFile.findConfigPathForFolder()` to find the relevant tsdoc.json config file, if one exists. ++ * Then calls `TSDocConfigFile.findConfigPathForFolder()` to return the loaded result. ++ * ++ * @remarks ++ * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check ++ * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, ++ * or {@link TSDocConfigFile.getErrorSummary}. ++ * ++ * @param folderPath - the path to a folder where the search should start ++ */ ++ static loadForFolder(folderPath) { ++ const rootConfigPath = TSDocConfigFile.findConfigPathForFolder(folderPath); ++ return TSDocConfigFile.loadFile(rootConfigPath); ++ } ++ /** ++ * Loads the specified tsdoc.json and any base files that it refers to using the "extends" option. ++ * ++ * @remarks ++ * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check ++ * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, ++ * or {@link TSDocConfigFile.getErrorSummary}. ++ * ++ * @param tsdocJsonFilePath - the path to the tsdoc.json config file ++ */ ++ static loadFile(tsdocJsonFilePath) { ++ const configFile = new TSDocConfigFile(); ++ const alreadyVisitedPaths = new Set(); ++ configFile._loadWithExtends( ++ tsdocJsonFilePath, ++ undefined, ++ alreadyVisitedPaths ++ ); ++ return configFile; ++ } ++ /** ++ * Loads the object state from a JSON-serializable object as produced by {@link TSDocConfigFile.saveToObject}. ++ * ++ * @remarks ++ * The serialized object has the same structure as `tsdoc.json`; however the `"extends"` field is not allowed. ++ * ++ * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check ++ * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, ++ * or {@link TSDocConfigFile.getErrorSummary}. ++ */ ++ static loadFromObject(jsonObject) { ++ const configFile = new TSDocConfigFile(); ++ configFile._loadJsonObject(jsonObject); ++ if (configFile.extendsPaths.length > 0) { ++ throw new Error( ++ 'The "extends" field cannot be used with TSDocConfigFile.loadFromObject()' ++ ); ++ } ++ return configFile; ++ } ++ /** ++ * Initializes a TSDocConfigFile object using the state from the provided `TSDocConfiguration` object. ++ * ++ * @remarks ++ * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check ++ * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, ++ * or {@link TSDocConfigFile.getErrorSummary}. ++ */ ++ static loadFromParser(configuration) { ++ const configFile = new TSDocConfigFile(); ++ // The standard tags will be mixed together with custom definitions, ++ // so set noStandardTags=true to avoid defining them twice. ++ configFile.noStandardTags = true; ++ for (const tagDefinition of configuration.tagDefinitions) { ++ configFile.addTagDefinition({ ++ syntaxKind: tagDefinition.syntaxKind, ++ tagName: tagDefinition.tagName, ++ allowMultiple: tagDefinition.allowMultiple, ++ }); ++ } ++ for (const tagDefinition of configuration.supportedTagDefinitions) { ++ configFile.setSupportForTag(tagDefinition.tagName, true); ++ } ++ for (const htmlElement of configuration.supportedHtmlElements) { ++ configFile.addSupportedHtmlElement(htmlElement); ++ } ++ configFile.reportUnsupportedHtmlElements = ++ configuration.validation.reportUnsupportedHtmlElements; ++ return configFile; ++ } ++ /** ++ * Writes the config file content to a JSON file with the specified file path. ++ */ ++ saveFile(jsonFilePath) { ++ const jsonObject = this.saveToObject(); ++ const jsonContent = JSON.stringify(jsonObject, undefined, 2); ++ fs.writeFileSync(jsonFilePath, jsonContent); ++ } ++ /** ++ * Writes the object state into a JSON-serializable object. ++ */ ++ saveToObject() { ++ const configJson = { ++ $schema: TSDocConfigFile.CURRENT_SCHEMA_URL, ++ }; ++ if (this.noStandardTags !== undefined) { ++ configJson.noStandardTags = this.noStandardTags; ++ } ++ if (this.tagDefinitions.length > 0) { ++ configJson.tagDefinitions = []; ++ for (const tagDefinition of this.tagDefinitions) { ++ configJson.tagDefinitions.push( ++ TSDocConfigFile._serializeTagDefinition(tagDefinition) ++ ); ++ } ++ } ++ if (this.supportForTags.size > 0) { ++ configJson.supportForTags = {}; ++ this.supportForTags.forEach((supported, tagName) => { ++ configJson.supportForTags[tagName] = supported; ++ }); ++ } ++ if (this.supportedHtmlElements) { ++ configJson.supportedHtmlElements = [...this.supportedHtmlElements]; ++ } ++ if (this._reportUnsupportedHtmlElements !== undefined) { ++ configJson.reportUnsupportedHtmlElements = ++ this._reportUnsupportedHtmlElements; ++ } ++ return configJson; ++ } ++ static _serializeTagDefinition(tagDefinition) { ++ let syntaxKind; ++ switch (tagDefinition.syntaxKind) { ++ case tsdoc_1.TSDocTagSyntaxKind.InlineTag: ++ syntaxKind = "inline"; ++ break; ++ case tsdoc_1.TSDocTagSyntaxKind.BlockTag: ++ syntaxKind = "block"; ++ break; ++ case tsdoc_1.TSDocTagSyntaxKind.ModifierTag: ++ syntaxKind = "modifier"; ++ break; ++ default: ++ throw new Error("Unimplemented TSDocTagSyntaxKind"); ++ } ++ const tagConfigJson = { ++ tagName: tagDefinition.tagName, ++ syntaxKind, ++ }; ++ if (tagDefinition.allowMultiple) { ++ tagConfigJson.allowMultiple = true; ++ } ++ return tagConfigJson; ++ } ++ /** ++ * Returns a report of any errors that occurred while attempting to load this file or any files ++ * referenced via the "extends" field. ++ * ++ * @remarks ++ * Use {@link TSDocConfigFile.hasErrors} to determine whether any errors occurred. ++ */ ++ getErrorSummary() { ++ if (!this._hasErrors) { ++ return "No errors."; ++ } ++ let result = ""; ++ if (this.log.messages.length > 0) { ++ const errorNoun = this.log.messages.length > 1 ? "Errors" : "Error"; ++ if (this.filePath) { ++ result += `${errorNoun} encountered for ${this.filePath}:\n`; ++ } else { ++ result += `${errorNoun} encountered when loading TSDoc configuration:\n`; ++ } ++ for (const message of this.log.messages) { ++ result += ` ${message.text}\n`; ++ } ++ } ++ for (const extendsFile of this.extendsFiles) { ++ if (extendsFile.hasErrors) { ++ if (result !== "") { ++ result += "\n"; ++ } ++ result += extendsFile.getErrorSummary(); ++ } + } +- _loadJsonObject(configJson) { +- if (configJson.$schema !== TSDocConfigFile.CURRENT_SCHEMA_URL) { +- this._reportError({ +- messageId: tsdoc_1.TSDocMessageId.ConfigFileUnsupportedSchema, +- messageText: `Unsupported JSON "$schema" value; expecting "${TSDocConfigFile.CURRENT_SCHEMA_URL}"`, +- textRange: tsdoc_1.TextRange.empty, +- }); +- return; +- } +- const success = tsdocSchemaValidator(configJson); +- if (!success) { +- const description = ajv.errorsText(tsdocSchemaValidator.errors); +- this._reportError({ +- messageId: tsdoc_1.TSDocMessageId.ConfigFileSchemaError, +- messageText: 'Error loading config file: ' + description, +- textRange: tsdoc_1.TextRange.empty, +- }); +- return; +- } +- this._tsdocSchema = configJson.$schema; +- if (configJson.extends) { +- this._extendsPaths.push(...configJson.extends); +- } +- this.noStandardTags = configJson.noStandardTags; +- for (const jsonTagDefinition of configJson.tagDefinitions || []) { +- let syntaxKind; +- switch (jsonTagDefinition.syntaxKind) { +- case 'inline': +- syntaxKind = tsdoc_1.TSDocTagSyntaxKind.InlineTag; +- break; +- case 'block': +- syntaxKind = tsdoc_1.TSDocTagSyntaxKind.BlockTag; +- break; +- case 'modifier': +- syntaxKind = tsdoc_1.TSDocTagSyntaxKind.ModifierTag; +- break; +- default: +- // The JSON schema should have caught this error +- throw new Error('Unexpected tag kind'); +- } +- this._addTagDefinitionForLoad({ +- tagName: jsonTagDefinition.tagName, +- syntaxKind: syntaxKind, +- allowMultiple: jsonTagDefinition.allowMultiple, +- }); +- } +- if (configJson.supportedHtmlElements) { +- this._supportedHtmlElements = new Set(); +- for (const htmlElement of configJson.supportedHtmlElements) { +- this.addSupportedHtmlElement(htmlElement); +- } +- } +- this._reportUnsupportedHtmlElements = configJson.reportUnsupportedHtmlElements; +- if (configJson.supportForTags) { +- for (const tagName of Object.keys(configJson.supportForTags)) { +- const supported = configJson.supportForTags[tagName]; +- this._supportForTags.set(tagName, supported); +- } +- } +- } +- _loadWithExtends(configFilePath, referencingConfigFile, alreadyVisitedPaths) { +- // In case an exception is thrown, start by assuming that the file was not found; we'll revise +- // this later upon success +- this._fileNotFound = true; +- if (!configFilePath) { +- this._reportError({ +- messageId: tsdoc_1.TSDocMessageId.ConfigFileNotFound, +- messageText: 'File not found', +- textRange: tsdoc_1.TextRange.empty, +- }); +- return; +- } +- this._filePath = path.resolve(configFilePath); +- if (!fs.existsSync(this._filePath)) { +- this._reportError({ +- messageId: tsdoc_1.TSDocMessageId.ConfigFileNotFound, +- messageText: 'File not found', +- textRange: tsdoc_1.TextRange.empty, +- }); +- return; +- } +- const configJsonContent = fs.readFileSync(this._filePath).toString(); +- this._fileMTime = fs.statSync(this._filePath).mtimeMs; +- this._fileNotFound = false; +- const hashKey = fs.realpathSync(this._filePath); +- if (referencingConfigFile && alreadyVisitedPaths.has(hashKey)) { +- this._reportError({ +- messageId: tsdoc_1.TSDocMessageId.ConfigFileCyclicExtends, +- messageText: `Circular reference encountered for "extends" field of "${referencingConfigFile.filePath}"`, +- textRange: tsdoc_1.TextRange.empty, +- }); +- return; +- } +- alreadyVisitedPaths.add(hashKey); +- let configJson; +- try { +- configJson = jju.parse(configJsonContent, { mode: 'cjson' }); +- } +- catch (e) { +- this._reportError({ +- messageId: tsdoc_1.TSDocMessageId.ConfigInvalidJson, +- messageText: 'Error parsing JSON input: ' + e.message, +- textRange: tsdoc_1.TextRange.empty, +- }); +- return; +- } +- this._loadJsonObject(configJson); +- const configFileFolder = path.dirname(this.filePath); +- for (const extendsField of this.extendsPaths) { +- let resolvedExtendsPath; +- try { +- resolvedExtendsPath = resolve.sync(extendsField, { basedir: configFileFolder }); +- } +- catch (e) { +- this._reportError({ +- messageId: tsdoc_1.TSDocMessageId.ConfigFileUnresolvedExtends, +- messageText: `Unable to resolve "extends" reference to "${extendsField}": ` + e.message, +- textRange: tsdoc_1.TextRange.empty, +- }); +- return; +- } +- const baseConfigFile = new TSDocConfigFile(); +- baseConfigFile._loadWithExtends(resolvedExtendsPath, this, alreadyVisitedPaths); +- if (baseConfigFile.fileNotFound) { +- this._reportError({ +- messageId: tsdoc_1.TSDocMessageId.ConfigFileUnresolvedExtends, +- messageText: `Unable to resolve "extends" reference to "${extendsField}"`, +- textRange: tsdoc_1.TextRange.empty, +- }); +- } +- this._extendsFiles.push(baseConfigFile); +- if (baseConfigFile.hasErrors) { +- this._hasErrors = true; +- } +- } +- } +- /** +- * For the given folder, look for the relevant tsdoc.json file (if any), and return its path. +- * +- * @param folderPath - the path to a folder where the search should start +- * @returns the (possibly relative) path to tsdoc.json, or an empty string if not found +- */ +- static findConfigPathForFolder(folderPath) { +- if (folderPath) { +- let foundFolder = folderPath; +- for (;;) { +- const tsconfigJsonPath = path.join(foundFolder, 'tsconfig.json'); +- if (fs.existsSync(tsconfigJsonPath)) { +- // Stop when we reach a folder containing tsconfig.json +- return path.join(foundFolder, TSDocConfigFile.FILENAME); +- } +- const packageJsonPath = path.join(foundFolder, 'package.json'); +- if (fs.existsSync(packageJsonPath)) { +- // Stop when we reach a folder containing package.json; this avoids crawling out of the current package +- return path.join(foundFolder, TSDocConfigFile.FILENAME); +- } +- const previousFolder = foundFolder; +- foundFolder = path.dirname(foundFolder); +- if (!foundFolder || foundFolder === previousFolder) { +- // Give up if we reach the filesystem root directory +- break; +- } +- } +- } +- return ''; +- } +- /** +- * Calls `TSDocConfigFile.findConfigPathForFolder()` to find the relevant tsdoc.json config file, if one exists. +- * Then calls `TSDocConfigFile.findConfigPathForFolder()` to return the loaded result. +- * +- * @remarks +- * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check +- * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, +- * or {@link TSDocConfigFile.getErrorSummary}. +- * +- * @param folderPath - the path to a folder where the search should start +- */ +- static loadForFolder(folderPath) { +- const rootConfigPath = TSDocConfigFile.findConfigPathForFolder(folderPath); +- return TSDocConfigFile.loadFile(rootConfigPath); +- } +- /** +- * Loads the specified tsdoc.json and any base files that it refers to using the "extends" option. +- * +- * @remarks +- * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check +- * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, +- * or {@link TSDocConfigFile.getErrorSummary}. +- * +- * @param tsdocJsonFilePath - the path to the tsdoc.json config file +- */ +- static loadFile(tsdocJsonFilePath) { +- const configFile = new TSDocConfigFile(); +- const alreadyVisitedPaths = new Set(); +- configFile._loadWithExtends(tsdocJsonFilePath, undefined, alreadyVisitedPaths); +- return configFile; +- } +- /** +- * Loads the object state from a JSON-serializable object as produced by {@link TSDocConfigFile.saveToObject}. +- * +- * @remarks +- * The serialized object has the same structure as `tsdoc.json`; however the `"extends"` field is not allowed. +- * +- * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check +- * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, +- * or {@link TSDocConfigFile.getErrorSummary}. +- */ +- static loadFromObject(jsonObject) { +- const configFile = new TSDocConfigFile(); +- configFile._loadJsonObject(jsonObject); +- if (configFile.extendsPaths.length > 0) { +- throw new Error('The "extends" field cannot be used with TSDocConfigFile.loadFromObject()'); +- } +- return configFile; +- } +- /** +- * Initializes a TSDocConfigFile object using the state from the provided `TSDocConfiguration` object. +- * +- * @remarks +- * This API does not report loading errors by throwing exceptions. Instead, the caller is expected to check +- * for errors using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, +- * or {@link TSDocConfigFile.getErrorSummary}. +- */ +- static loadFromParser(configuration) { +- const configFile = new TSDocConfigFile(); +- // The standard tags will be mixed together with custom definitions, +- // so set noStandardTags=true to avoid defining them twice. +- configFile.noStandardTags = true; +- for (const tagDefinition of configuration.tagDefinitions) { +- configFile.addTagDefinition({ +- syntaxKind: tagDefinition.syntaxKind, +- tagName: tagDefinition.tagName, +- allowMultiple: tagDefinition.allowMultiple, +- }); +- } +- for (const tagDefinition of configuration.supportedTagDefinitions) { +- configFile.setSupportForTag(tagDefinition.tagName, true); +- } +- for (const htmlElement of configuration.supportedHtmlElements) { +- configFile.addSupportedHtmlElement(htmlElement); +- } +- configFile.reportUnsupportedHtmlElements = configuration.validation.reportUnsupportedHtmlElements; +- return configFile; +- } +- /** +- * Writes the config file content to a JSON file with the specified file path. +- */ +- saveFile(jsonFilePath) { +- const jsonObject = this.saveToObject(); +- const jsonContent = JSON.stringify(jsonObject, undefined, 2); +- fs.writeFileSync(jsonFilePath, jsonContent); +- } +- /** +- * Writes the object state into a JSON-serializable object. +- */ +- saveToObject() { +- const configJson = { +- $schema: TSDocConfigFile.CURRENT_SCHEMA_URL, +- }; +- if (this.noStandardTags !== undefined) { +- configJson.noStandardTags = this.noStandardTags; +- } +- if (this.tagDefinitions.length > 0) { +- configJson.tagDefinitions = []; +- for (const tagDefinition of this.tagDefinitions) { +- configJson.tagDefinitions.push(TSDocConfigFile._serializeTagDefinition(tagDefinition)); +- } +- } +- if (this.supportForTags.size > 0) { +- configJson.supportForTags = {}; +- this.supportForTags.forEach((supported, tagName) => { +- configJson.supportForTags[tagName] = supported; +- }); +- } +- if (this.supportedHtmlElements) { +- configJson.supportedHtmlElements = [...this.supportedHtmlElements]; +- } +- if (this._reportUnsupportedHtmlElements !== undefined) { +- configJson.reportUnsupportedHtmlElements = this._reportUnsupportedHtmlElements; +- } +- return configJson; +- } +- static _serializeTagDefinition(tagDefinition) { +- let syntaxKind; +- switch (tagDefinition.syntaxKind) { +- case tsdoc_1.TSDocTagSyntaxKind.InlineTag: +- syntaxKind = 'inline'; +- break; +- case tsdoc_1.TSDocTagSyntaxKind.BlockTag: +- syntaxKind = 'block'; +- break; +- case tsdoc_1.TSDocTagSyntaxKind.ModifierTag: +- syntaxKind = 'modifier'; +- break; +- default: +- throw new Error('Unimplemented TSDocTagSyntaxKind'); +- } +- const tagConfigJson = { +- tagName: tagDefinition.tagName, +- syntaxKind, +- }; +- if (tagDefinition.allowMultiple) { +- tagConfigJson.allowMultiple = true; +- } +- return tagConfigJson; +- } +- /** +- * Returns a report of any errors that occurred while attempting to load this file or any files +- * referenced via the "extends" field. +- * +- * @remarks +- * Use {@link TSDocConfigFile.hasErrors} to determine whether any errors occurred. +- */ +- getErrorSummary() { +- if (!this._hasErrors) { +- return 'No errors.'; +- } +- let result = ''; +- if (this.log.messages.length > 0) { +- const errorNoun = this.log.messages.length > 1 ? 'Errors' : 'Error'; +- if (this.filePath) { +- result += `${errorNoun} encountered for ${this.filePath}:\n`; +- } +- else { +- result += `${errorNoun} encountered when loading TSDoc configuration:\n`; +- } +- for (const message of this.log.messages) { +- result += ` ${message.text}\n`; +- } +- } +- for (const extendsFile of this.extendsFiles) { +- if (extendsFile.hasErrors) { +- if (result !== '') { +- result += '\n'; +- } +- result += extendsFile.getErrorSummary(); +- } +- } +- return result; +- } +- /** +- * Applies the settings from this config file to a TSDoc parser configuration. +- * Any `extendsFile` settings will also applied. +- * +- * @remarks +- * Additional validation is performed during this operation. The caller is expected to check for errors +- * using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, or {@link TSDocConfigFile.getErrorSummary}. +- */ +- configureParser(configuration) { +- if (this._getNoStandardTagsWithExtends()) { +- // Do not define standard tags +- configuration.clear(true); +- } +- else { +- // Define standard tags (the default behavior) +- configuration.clear(false); +- } +- this.updateParser(configuration); +- } +- /** +- * This is the same as {@link configureParser}, but it preserves any previous state. +- * +- * @remarks +- * Additional validation is performed during this operation. The caller is expected to check for errors +- * using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, or {@link TSDocConfigFile.getErrorSummary}. +- */ +- updateParser(configuration) { +- // First apply the base config files +- for (const extendsFile of this.extendsFiles) { +- extendsFile.updateParser(configuration); +- } +- // Then apply this one +- for (const tagDefinition of this.tagDefinitions) { +- configuration.addTagDefinition(tagDefinition); +- } +- this.supportForTags.forEach((supported, tagName) => { +- const tagDefinition = configuration.tryGetTagDefinition(tagName); +- if (tagDefinition) { +- // Note that setSupportForTag() automatically enables configuration.validation.reportUnsupportedTags +- configuration.setSupportForTag(tagDefinition, supported); +- } +- else { +- // Note that this validation may depend partially on the preexisting state of the TSDocConfiguration +- // object, so it cannot be performed during the TSConfigFile.loadFile() stage. +- this._reportError({ +- messageId: tsdoc_1.TSDocMessageId.ConfigFileUndefinedTag, +- messageText: `The "supportForTags" field refers to an undefined tag ${JSON.stringify(tagName)}.`, +- textRange: tsdoc_1.TextRange.empty, +- }); +- } ++ return result; ++ } ++ /** ++ * Applies the settings from this config file to a TSDoc parser configuration. ++ * Any `extendsFile` settings will also applied. ++ * ++ * @remarks ++ * Additional validation is performed during this operation. The caller is expected to check for errors ++ * using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, or {@link TSDocConfigFile.getErrorSummary}. ++ */ ++ configureParser(configuration) { ++ if (this._getNoStandardTagsWithExtends()) { ++ // Do not define standard tags ++ configuration.clear(true); ++ } else { ++ // Define standard tags (the default behavior) ++ configuration.clear(false); ++ } ++ this.updateParser(configuration); ++ } ++ /** ++ * This is the same as {@link configureParser}, but it preserves any previous state. ++ * ++ * @remarks ++ * Additional validation is performed during this operation. The caller is expected to check for errors ++ * using {@link TSDocConfigFile.hasErrors}, {@link TSDocConfigFile.log}, or {@link TSDocConfigFile.getErrorSummary}. ++ */ ++ updateParser(configuration) { ++ // First apply the base config files ++ for (const extendsFile of this.extendsFiles) { ++ extendsFile.updateParser(configuration); ++ } ++ // Then apply this one ++ for (const tagDefinition of this.tagDefinitions) { ++ configuration.addTagDefinition(tagDefinition); ++ } ++ this.supportForTags.forEach((supported, tagName) => { ++ const tagDefinition = configuration.tryGetTagDefinition(tagName); ++ if (tagDefinition) { ++ // Note that setSupportForTag() automatically enables configuration.validation.reportUnsupportedTags ++ configuration.setSupportForTag(tagDefinition, supported); ++ } else { ++ // Note that this validation may depend partially on the preexisting state of the TSDocConfiguration ++ // object, so it cannot be performed during the TSConfigFile.loadFile() stage. ++ this._reportError({ ++ messageId: tsdoc_1.TSDocMessageId.ConfigFileUndefinedTag, ++ messageText: `The "supportForTags" field refers to an undefined tag ${JSON.stringify( ++ tagName ++ )}.`, ++ textRange: tsdoc_1.TextRange.empty, + }); +- if (this.supportedHtmlElements) { +- configuration.setSupportedHtmlElements([...this.supportedHtmlElements]); +- } +- if (this._reportUnsupportedHtmlElements === false) { +- configuration.validation.reportUnsupportedHtmlElements = false; +- } +- else if (this._reportUnsupportedHtmlElements === true) { +- configuration.validation.reportUnsupportedHtmlElements = true; +- } +- } +- _getNoStandardTagsWithExtends() { +- if (this.noStandardTags !== undefined) { +- return this.noStandardTags; +- } +- // This config file does not specify "noStandardTags", so consider any base files referenced using "extends" +- let result = undefined; +- for (const extendsFile of this.extendsFiles) { +- const extendedValue = extendsFile._getNoStandardTagsWithExtends(); +- if (extendedValue !== undefined) { +- result = extendedValue; +- } +- } +- if (result === undefined) { +- // If no config file specifies noStandardTags, then it defaults to false +- result = false; +- } +- return result; ++ } ++ }); ++ if (this.supportedHtmlElements) { ++ configuration.setSupportedHtmlElements([...this.supportedHtmlElements]); ++ } ++ if (this._reportUnsupportedHtmlElements === false) { ++ configuration.validation.reportUnsupportedHtmlElements = false; ++ } else if (this._reportUnsupportedHtmlElements === true) { ++ configuration.validation.reportUnsupportedHtmlElements = true; ++ } ++ } ++ _getNoStandardTagsWithExtends() { ++ if (this.noStandardTags !== undefined) { ++ return this.noStandardTags; ++ } ++ // This config file does not specify "noStandardTags", so consider any base files referenced using "extends" ++ let result = undefined; ++ for (const extendsFile of this.extendsFiles) { ++ const extendedValue = extendsFile._getNoStandardTagsWithExtends(); ++ if (extendedValue !== undefined) { ++ result = extendedValue; ++ } ++ } ++ if (result === undefined) { ++ // If no config file specifies noStandardTags, then it defaults to false ++ result = false; + } ++ return result; ++ } + } + exports.TSDocConfigFile = TSDocConfigFile; +-TSDocConfigFile.FILENAME = 'tsdoc.json'; +-TSDocConfigFile.CURRENT_SCHEMA_URL = 'https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json'; ++TSDocConfigFile.FILENAME = "tsdoc.json"; ++TSDocConfigFile.CURRENT_SCHEMA_URL = ++ "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json"; + //# sourceMappingURL=TSDocConfigFile.js.map diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b46e272..a148e61 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,11 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +patchedDependencies: + '@microsoft/tsdoc-config@0.16.2': + hash: fbrhds4pfv5d2ie5aolb6q2rxi + path: patches/@microsoft__tsdoc-config@0.16.2.patch + importers: .: @@ -14,6 +19,9 @@ importers: '@commitlint/config-conventional': specifier: ^17.7.0 version: 17.8.1 + '@microsoft/api-extractor': + specifier: ^7.43.1 + version: 7.43.4(@types/node@20.12.12) '@semantic-release/git': specifier: ^10.0.1 version: 10.0.1(semantic-release@22.0.12) @@ -97,7 +105,7 @@ importers: version: 0.14.2 '@microsoft/tsdoc-config': specifier: ^0.16.2 - version: 0.16.2 + version: 0.16.2(patch_hash=fbrhds4pfv5d2ie5aolb6q2rxi) '@react-icons/all-files': specifier: ^4.1.0 version: 4.1.0(react@18.3.1) @@ -1058,11 +1066,10 @@ packages: resolution: {integrity: sha512-4/5gbW9zazr7hHHdv32QoCFDQl4vsrMOFp7g9k/uIQR2mn7AqQVN6NvNOAnFi1xwCM6X3K1BN1ZWf9ARF5hUmA==} dependencies: '@microsoft/tsdoc': 0.14.2 - '@microsoft/tsdoc-config': 0.16.2 + '@microsoft/tsdoc-config': 0.16.2(patch_hash=fbrhds4pfv5d2ie5aolb6q2rxi) '@rushstack/node-core-library': 4.2.1(@types/node@20.12.12) transitivePeerDependencies: - '@types/node' - dev: false /@microsoft/api-extractor@7.43.4(@types/node@20.12.12): resolution: {integrity: sha512-HMzeVcTbzpiVvAUOnUVOxhPGPjOlPQQjiHVZy3fsXm6D5MUiEqX0OWEuupV8Ba3LM7h1Vk8xnNghlwpCkY73UA==} @@ -1070,7 +1077,7 @@ packages: dependencies: '@microsoft/api-extractor-model': 7.28.16(@types/node@20.12.12) '@microsoft/tsdoc': 0.14.2 - '@microsoft/tsdoc-config': 0.16.2 + '@microsoft/tsdoc-config': 0.16.2(patch_hash=fbrhds4pfv5d2ie5aolb6q2rxi) '@rushstack/node-core-library': 4.2.1(@types/node@20.12.12) '@rushstack/rig-package': 0.5.2 '@rushstack/terminal': 0.10.3(@types/node@20.12.12) @@ -1083,20 +1090,18 @@ packages: typescript: 5.4.2 transitivePeerDependencies: - '@types/node' - dev: false - /@microsoft/tsdoc-config@0.16.2: + /@microsoft/tsdoc-config@0.16.2(patch_hash=fbrhds4pfv5d2ie5aolb6q2rxi): resolution: {integrity: sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==} dependencies: '@microsoft/tsdoc': 0.14.2 ajv: 6.12.6 jju: 1.4.0 resolve: 1.19.0 - dev: false + patched: true /@microsoft/tsdoc@0.14.2: resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==} - dev: false /@next/env@14.1.0: resolution: {integrity: sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==} @@ -1875,14 +1880,12 @@ packages: resolve: 1.22.8 semver: 7.5.4 z-schema: 5.0.5 - dev: false /@rushstack/rig-package@0.5.2: resolution: {integrity: sha512-mUDecIJeH3yYGZs2a48k+pbhM6JYwWlgjs2Ca5f2n1G2/kgdgP9D/07oglEGf6mRyXEnazhEENeYTSNDRCwdqA==} dependencies: resolve: 1.22.8 strip-json-comments: 3.1.1 - dev: false /@rushstack/terminal@0.10.3(@types/node@20.12.12): resolution: {integrity: sha512-4wEPvn9bTD4cixW+FQxlCtZmVIp73gUEAFutPXDo7Nik5bqmbP+fkZcd3Zjr+hOQyyu85d6+1R1DOPcchJX5ww==} @@ -1895,7 +1898,6 @@ packages: '@rushstack/node-core-library': 4.2.1(@types/node@20.12.12) '@types/node': 20.12.12 supports-color: 8.1.1 - dev: false /@rushstack/ts-command-line@4.19.5(@types/node@20.12.12): resolution: {integrity: sha512-0baDWdyMeB2LFHn1T8PKmy2rGclJoDruOjxwARrM4Oe66YjO9GfVZYwpM8ePdzJprWhkCnYLSxGUKJiWmUpapg==} @@ -1906,7 +1908,6 @@ packages: string-argv: 0.3.2 transitivePeerDependencies: - '@types/node' - dev: false /@semantic-release/commit-analyzer@11.1.0(semantic-release@22.0.12): resolution: {integrity: sha512-cXNTbv3nXR2hlzHjAMgbuiQVtvWHTlwwISt60B+4NZv01y/QRY7p2HcJm8Eh2StzcTJoNnflvKjHH/cjFS7d5g==} @@ -2147,7 +2148,6 @@ packages: /@types/argparse@1.0.38: resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} - dev: false /@types/body-parser@1.19.5: resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} @@ -2752,7 +2752,6 @@ packages: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: sprintf-js: 1.0.3 - dev: false /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -3308,7 +3307,6 @@ packages: resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} engines: {node: ^12.20.0 || >=14} requiresBuild: true - dev: false optional: true /compare-func@2.0.0: @@ -4816,7 +4814,6 @@ packages: graceful-fs: 4.2.11 jsonfile: 4.0.0 universalify: 0.1.2 - dev: false /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -5256,7 +5253,6 @@ packages: /import-lazy@4.0.0: resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==} engines: {node: '>=8'} - dev: false /import-meta-resolve@4.1.0: resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} @@ -5706,7 +5702,6 @@ packages: /jju@1.4.0: resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} - dev: false /js-cookie@2.2.1: resolution: {integrity: sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==} @@ -5757,7 +5752,6 @@ packages: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: graceful-fs: 4.2.11 - dev: false /jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} @@ -5928,11 +5922,9 @@ packages: /lodash.get@4.4.2: resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} - dev: false /lodash.isequal@4.5.0: resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} - dev: false /lodash.isfunction@3.0.9: resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} @@ -7049,7 +7041,6 @@ packages: resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==} dependencies: brace-expansion: 1.1.11 - dev: false /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -8408,7 +8399,6 @@ packages: dependencies: is-core-module: 2.13.1 path-parse: 1.0.7 - dev: false /resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} @@ -8859,7 +8849,6 @@ packages: /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - dev: false /stack-generator@2.0.10: resolution: {integrity: sha512-mwnua/hkqM6pF4k8SnmZ2zfETsRUpWXREfA/goT8SLCV4iOFa4bzOX2nDipWAZFPTjLvQB82f5yaodMVhK0yJQ==} @@ -9532,7 +9521,6 @@ packages: resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==} engines: {node: '>=14.17'} hasBin: true - dev: false /typescript@5.4.5: resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} @@ -9699,7 +9687,6 @@ packages: /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} - dev: false /universalify@2.0.1: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} @@ -9800,7 +9787,6 @@ packages: /validator@13.12.0: resolution: {integrity: sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==} engines: {node: '>= 0.10'} - dev: false /vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} @@ -10012,7 +9998,6 @@ packages: validator: 13.12.0 optionalDependencies: commander: 9.5.0 - dev: false /zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} diff --git a/tsdoc.json b/tsdoc.json new file mode 100644 index 0000000..eb16268 --- /dev/null +++ b/tsdoc.json @@ -0,0 +1,77 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", + "extends": ["@microsoft/api-extractor/extends/tsdoc-base.json"], + "tagDefinitions": [ + { + "allowMultiple": false, + "syntaxKind": "block", + "tagName": "@memberof" + }, + { + "allowMultiple": false, + "syntaxKind": "block", + "tagName": "@interface" + }, + { + "allowMultiple": false, + "syntaxKind": "block", + "tagName": "@class" + }, + { + "allowMultiple": true, + "syntaxKind": "block", + "tagName": "@extends" + }, + { + "allowMultiple": false, + "syntaxKind": "block", + "tagName": "@implements" + }, + { + "allowMultiple": false, + "syntaxKind": "block", + "tagName": "@type" + }, + { + "allowMultiple": false, + "syntaxKind": "block", + "tagName": "@constructor" + } + ], + "noStandardTags": false, + "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, + + "@memberof": true, + "@interface": true, + "@class": true, + "@extends": true, + "@implements": true, + "@type": true, + "@constructor": true + } +} From 25f7ca71e043f57097b48fcba867adc370025795 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 15 May 2024 18:42:05 +0000 Subject: [PATCH 2/2] chore(release): 0.0.5 [skip ci] # [@wapijs/wapi.js-v0.0.5](https://github.com/sarthakjdev/wapi.js/compare/@wapijs/wapi.js-v0.0.4...@wapijs/wapi.js-v0.0.5) (2024-05-15) ### Bug Fixes * module not found in docs ([#24](https://github.com/sarthakjdev/wapi.js/issues/24)) ([142bec3](https://github.com/sarthakjdev/wapi.js/commit/142bec303f66b27d66cb1de5541005e60bcecff6)) --- packages/wapi.js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wapi.js/package.json b/packages/wapi.js/package.json index 9781434..53b260c 100644 --- a/packages/wapi.js/package.json +++ b/packages/wapi.js/package.json @@ -1,6 +1,6 @@ { "name": "@wapijs/wapi.js", - "version": "0.0.4", + "version": "0.0.5", "description": "a typescript based client library to build whatsapp cloud api based chat bots", "main": "dist/cjs/index.js", "module": "dist/esm/index.js",