@open-wa/integration-webhook 5.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,30 @@
1
+
2
+ > @open-wa/integration-webhook@5.0.0-alpha.0 build /Users/Mohammed/projects/tools/wa/integrations/webhook
3
+ > tsdown src/index.ts --format esm --dts
4
+
5
+ ℹ tsdown v0.21.7 powered by rolldown v1.0.0-rc.12
6
+ ℹ entry: src/index.ts
7
+ ℹ tsconfig: tsconfig.json
8
+ ℹ Build start
9
+ ℹ Cleaning 4 files
10
+ ℹ dist/index.mjs 3.41 kB │ gzip: 1.44 kB
11
+ ℹ dist/index.mjs.map 7.13 kB │ gzip: 2.62 kB
12
+ ℹ dist/index.d.mts.map 6.17 kB │ gzip: 2.42 kB
13
+ ℹ dist/index.d.mts 3.13 kB │ gzip: 1.02 kB
14
+ ℹ 4 files, total: 19.83 kB
15
+ ../../node_modules/winston/index.d.ts (6:247) [IMPORT_IS_UNDEFINED] Warning: Import `AbstractConfigSetLevels` will always be undefined because there is no matching export in '../../node_modules/winston/lib/winston/config/index.d.ts'
16
+ - in ../../node_modules/winston/index.d.ts at 487..517
17
+
18
+ ../../node_modules/winston/index.d.ts (6:358) [IMPORT_IS_UNDEFINED] Warning: Import `AbstractConfigSetLevels` will always be undefined because there is no matching export in '../../node_modules/winston/lib/winston/config/index.d.ts'
19
+ - in ../../node_modules/winston/index.d.ts at 598..628
20
+
21
+ ../../node_modules/winston/index.d.ts (6:977) [IMPORT_IS_UNDEFINED] Warning: Import `AbstractConfigSetColors` will always be undefined because there is no matching export in '../../node_modules/winston/lib/winston/config/index.d.ts'
22
+ - in ../../node_modules/winston/index.d.ts at 1217..1247
23
+
24
+ [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugins. Here is a breakdown:
25
+ - rolldown-plugin-dts:generate (37%)
26
+ - rolldown-plugin-dts:resolver (34%)
27
+ - rolldown-plugin-dts:fake-js (23%)
28
+ See https://rolldown.rs/options/checks#plugintimings for more details.
29
+
30
+ ✔ Build complete in 6382ms
File without changes
package/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ # @open-wa/integration-webhook
2
+
3
+ ## 5.0.0-alpha.3
4
+
5
+ ### Minor Changes
6
+
7
+ - Dry run minor bump
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies []:
12
+ - @open-wa/plugin-sdk@5.0.0-alpha.2
13
+
14
+ ## 5.0.0-alpha.2
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies []:
19
+ - @open-wa/plugin-sdk@5.0.1-alpha.2
package/LICENSE.md ADDED
@@ -0,0 +1,67 @@
1
+ ### Copyright (c) 2020 Mohammed Shah
2
+
3
+ # Hippocratic + Do Not Harm (H-DNH) Version 1.1
4
+
5
+ ## Preamble
6
+
7
+ Most software today is developed with little to no thought of how it will be used, or the consequences for our society and planet.
8
+
9
+ As software developers, we engineer the infrastructure of the 21st century. We recognise that our infrastructure has great power to shape the world and the lives of those we share it with, and we choose to consciously take responsibility for the social and environmental impacts of what we build.
10
+
11
+ We envisage a world free from injustice, inequality, and the reckless destruction of lives and our planet. We reject slavery in all its forms, whether by force, indebtedness, or by algorithms that hack human vulnerabilities. We seek a world where humankind is at peace with our neighbours, nature, and ourselves. We want our work to enrich the physical, mental and spiritual wellbeing of all society.
12
+
13
+ We build software to further this vision of a just world, or at the very least, to not put that vision further from reach.
14
+
15
+ ## Terms
16
+
17
+ Licensor hereby grants permission by this license ("License"), free of charge, to any person or entity (the "Licensee") obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
18
+
19
+ 1. All redistribution of source code or binary form, including any modifications must be under these terms. You must inform recipients that the code is governed by these conditions, and how they can obtain a copy of this license. You may not attempt to alter the conditions of who may/may not use this software.
20
+
21
+ 2. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
22
+
23
+ 3. This software must not be used by any organisation, website, product or service that:
24
+
25
+ a) lobbies for, promotes, or derives a majority of income from actions that support or contribute to:
26
+ * sex trafficking
27
+ * human trafficking
28
+ * slavery
29
+ * indentured servitude
30
+ * gambling
31
+ * tobacco
32
+ * adversely addictive behaviours
33
+ * nuclear energy
34
+ * warfare
35
+ * weapons manufacturing
36
+ * war crimes
37
+ * settler colonialism
38
+ * apartheid
39
+ * vaccine misinformation
40
+ * climate misinformation
41
+ * child endangerment
42
+ * violence (except when required to protect public safety)
43
+ * burning of forests
44
+ * deforestation
45
+ * hate speech or discrimination based on age, gender, gender identity, race, sexuality, religion, nationality
46
+
47
+ b) lobbies against, or derives a majority of income from actions that discourage or frustrate:
48
+ * peace
49
+ * access to the rights set out in the Universal Declaration of Human Rights and the Convention on the Rights of the Child
50
+ * peaceful assembly and association (including worker associations)
51
+ * a safe environment or action to curtail the use of fossil fuels or prevent climate change
52
+ * democratic processes
53
+
54
+
55
+ 4. Compliance with Human Rights Laws and Human Rights Principles:
56
+
57
+ a. **Human Rights Laws**. The Software shall not be used by any person or entity for any systems, activities, or other uses that violate any applicable laws, regulations, or rules that protect human, civil, labor, privacy, political, environmental, security, economic, due process, or similar rights (the "Human Rights Laws"). Where the Human Rights Laws of more than one jurisdiction are applicable to the use of the Software, the Human Rights Laws that are most protective of the individuals or groups harmed shall apply.
58
+
59
+ b. **Human Rights Principles**. Licensee is advised to consult the articles of the United Nations Universal Declaration of Human Rights (https://www.un.org/en/universal-declaration-human-rights/) and the United Nations Global Compact (https://www.unglobalcompact.org/ what-is-gc/mission/principles) that define recognized principles of international human rights (the "Human Rights Principles"). It is Licensor's express intent that all use of the Software be consistent with Human Rights Principles. If Licensor receives notification or otherwise learns of an alleged violation of any Human Rights Principles relating to Licensee's use of the Software, Licensor may in its discretion and without obligation (i) (a) notify Licensee of such allegation and (b) allow Licensee 90 days from notification under (i)(a) to investigate and respond to Licensor regarding the allegation and (ii) (a) after the earlier of 90 days from notification under (i)(a), or Licensee's response under (i)(b), notify Licensee of License termination and (b) allow Licensee an additional 90 days from notification under (ii)(a) to cease use of the Software.
60
+
61
+ c. **Indemnity**. Licensee shall hold harmless and indemnify Licensor against all losses, damages, liabilities, deficiencies, claims, actions, judgments, settlements, interest, awards, penalties, fines, costs, or expenses of whatever kind, including Licensor's reasonable attorneys' fees, arising out of or relating to Licensee's non-compliance with this License or use of the Software in violation of Human Rights Laws or Human Rights Principles. 
62
+
63
+ 5. Enforceability: If any portion or provision of this License is determined to be invalid, illegal, or unenforceable by a court of competent jurisdiction, then such invalidity, illegality, or unenforceability shall not affect any other term or provision of this License or invalidate or render unenforceable such term or provision in any other jurisdiction. Upon a determination that any term or provision is invalid, illegal, or unenforceable, to the extent permitted by applicable law, the court may modify this License to affect the original intent of the parties as closely as possible. The section headings are for convenience only and are not intended to affect the construction or interpretation of this License. Any rule of construction to the effect that ambiguities are to be resolved against the drafting party shall not apply in interpreting this License. The language in this License shall be interpreted as to its fair meaning and not strictly for or against any party.
64
+
65
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
66
+
67
+ This license is an extension of the Hippocratic License - an Ethical Source license (https://ethicalsource.dev) and the Do Not Harm License - (https://github.com/raisely/NoHarm)
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # @open-wa/integration-webhook
2
+
3
+ Webhook delivery integration plugin for open-wa
4
+
5
+ Part of the [@open-wa v5 monorepo](https://github.com/open-wa/wa-automate-nodejs).
6
+
7
+ ## What it does
8
+
9
+ `@open-wa/integration-webhook` forwards public open-wa events to an external URL with HTTP `POST`. It supports event filtering, custom headers, request timeouts, retry with exponential backoff, and concurrent delivery through a queue.
10
+
11
+ Use this integration when another service should receive open-wa runtime events without embedding open-wa directly.
12
+
13
+ ## Configuration
14
+
15
+ The plugin config is validated by the plugin SDK schema in `src/plugin.ts`.
16
+
17
+ | Field | Required | Source-visible behavior |
18
+ | --- | --- | --- |
19
+ | `url` | Yes | Target URL for webhook delivery. Must be a URL. |
20
+ | `events` | No | `all` or an array of event names. Defaults to `all`. Non-matching events are skipped. |
21
+ | `concurrency` | No | Max concurrent deliveries. Defaults to 10. |
22
+ | `retries` | No | Number of retry attempts after a failed delivery. Defaults to 3. |
23
+ | `retryDelay` | No | Base retry delay in milliseconds. Defaults to 1000 and is exponentially backed off per attempt. |
24
+ | `headers` | No | Additional headers merged into each request. |
25
+ | `timeout` | No | Request timeout in milliseconds. Defaults to 30000. |
26
+
27
+ Each delivery also sends `Content-Type: application/json`.
28
+
29
+ ## Payload envelope
30
+
31
+ The payload shape is defined by `WebhookPayload` in `src/config.ts` and produced in `src/plugin.ts`.
32
+
33
+ | Field | Value |
34
+ | --- | --- |
35
+ | `webhookId` | A random UUID generated when the plugin initializes. |
36
+ | `sessionId` | The current open-wa session ID from the plugin host. |
37
+ | `event` | The event name received by the plugin. |
38
+ | `payload` | The event payload received by the plugin. |
39
+ | `timestamp` | `Date.now()` at delivery enqueue time. |
40
+
41
+ ## Runtime behavior
42
+
43
+ - During initialization, the plugin creates a `WebhookDeliverer`, computes the allowed event set, and logs the configured target URL.
44
+ - On each public `event` hook call, the plugin skips events outside the configured allowlist and enqueues the payload for delivery.
45
+ - `WebhookDeliverer` posts JSON with native `fetch` and aborts requests with `AbortController` when the timeout elapses.
46
+ - Non-2xx responses throw an error and enter the retry path.
47
+ - Retry delay is `retryDelay * 2 ** attempt` until the configured retry count is exhausted.
48
+ - Failed deliveries are logged after all attempts; the error is not rethrown from the final retry path.
49
+ - On `dispose`, the plugin waits for the queue to become idle and logs that the queue drained.
50
+
51
+ ## Exports
52
+
53
+ - Default export and `webhookPlugin` from `src/plugin.ts`.
54
+ - `WebhookDeliverer` from `src/deliverer.ts`.
55
+ - `WebhookPluginConfig`, `WebhookConfig`, `Webhook`, and `WebhookPayload` types.
56
+
57
+ ## Development
58
+
59
+ - `pnpm --filter @open-wa/integration-webhook build`
60
+ - `pnpm --filter @open-wa/integration-webhook dev`
61
+ - `pnpm --filter @open-wa/integration-webhook lint`
62
+ - `pnpm --filter @open-wa/integration-webhook clean`
63
+
64
+ ## Documentation
65
+
66
+ See the [docs site](https://docs.openwa.dev).
67
+
68
+ ## License
69
+
70
+ [H-DNH V1.0](https://github.com/open-wa/wa-automate-nodejs/blob/main/LICENSE.md) - Hippocratic + Do Not Harm
@@ -0,0 +1,106 @@
1
+ import * as _$_open_wa_plugin_sdk0 from "@open-wa/plugin-sdk";
2
+ import { z } from "@open-wa/plugin-sdk";
3
+
4
+ //#region src/plugin.d.ts
5
+ declare const configSchema: z.ZodObject<{
6
+ url: z.ZodString;
7
+ events: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"all">]>>;
8
+ concurrency: z.ZodDefault<z.ZodNumber>;
9
+ retries: z.ZodDefault<z.ZodNumber>;
10
+ retryDelay: z.ZodDefault<z.ZodNumber>;
11
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.core.SomeType>>;
12
+ timeout: z.ZodDefault<z.ZodNumber>;
13
+ }, z.core.$strip>;
14
+ type WebhookPluginConfig = z.infer<typeof configSchema>;
15
+ declare const _default: _$_open_wa_plugin_sdk0.Plugin<{
16
+ url: string;
17
+ events: "all" | string[];
18
+ concurrency: number;
19
+ retries: number;
20
+ retryDelay: number;
21
+ timeout: number;
22
+ headers?: Record<string, unknown> | undefined;
23
+ }>;
24
+ //#endregion
25
+ //#region src/config.d.ts
26
+ interface WebhookConfig {
27
+ url: string;
28
+ events?: string[] | 'all';
29
+ concurrency?: number;
30
+ retries?: number;
31
+ retryDelay?: number;
32
+ headers?: Record<string, string>;
33
+ timeout?: number;
34
+ }
35
+ interface Webhook {
36
+ id: string;
37
+ url: string;
38
+ events: string[];
39
+ headers?: Record<string, string>;
40
+ createdAt: number;
41
+ }
42
+ interface WebhookPayload {
43
+ webhookId: string;
44
+ sessionId: string;
45
+ event: string;
46
+ payload: unknown;
47
+ timestamp: number;
48
+ }
49
+ //#endregion
50
+ //#region ../../packages/logger/dist/index.d.cts
51
+ //#endregion
52
+ //#region src/core/context.d.ts
53
+ interface LogContext {
54
+ sessionId?: string;
55
+ driver?: 'puppeteer' | 'playwright' | 'remote';
56
+ requestId?: string;
57
+ schemaId?: string;
58
+ 'http.method'?: string;
59
+ 'http.path'?: string;
60
+ 'http.statusCode'?: number;
61
+ 'http.latencyMs'?: number;
62
+ traceId?: string;
63
+ spanId?: string;
64
+ isolateId?: string;
65
+ colo?: string;
66
+ doId?: string;
67
+ [key: string]: unknown;
68
+ }
69
+ //#endregion
70
+ //#region src/core/levels.d.ts
71
+ type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'fatal'; //#endregion
72
+ //#region src/core/logger.d.ts
73
+ interface LoggerInterface {
74
+ debug(message: string, meta?: LogContext): void;
75
+ info(message: string, meta?: LogContext): void;
76
+ warn(message: string, meta?: LogContext): void;
77
+ error(message: string, meta?: LogContext & {
78
+ error?: unknown;
79
+ }): void;
80
+ fatal(message: string, meta?: LogContext & {
81
+ error?: unknown;
82
+ }): void;
83
+ child(context: LogContext): LoggerInterface;
84
+ withContext(context: LogContext): LoggerInterface;
85
+ setLevel(level: LogLevel): void;
86
+ }
87
+ type Logger = LoggerInterface; //#endregion
88
+ //#region src/security/rules.d.ts
89
+ //#endregion
90
+ //#region src/deliverer.d.ts
91
+ declare class WebhookDeliverer {
92
+ private readonly config;
93
+ private readonly logger;
94
+ private readonly queue;
95
+ private readonly retries;
96
+ private readonly retryDelay;
97
+ private readonly timeout;
98
+ constructor(config: WebhookConfig, logger: Logger);
99
+ deliver(payload: WebhookPayload): Promise<void>;
100
+ private sendWithRetry;
101
+ private sleep;
102
+ waitForIdle(): Promise<void>;
103
+ }
104
+ //#endregion
105
+ export { type Webhook, type WebhookConfig, WebhookDeliverer, type WebhookPayload, type WebhookPluginConfig, _default as default, _default as webhookPlugin };
106
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":["winston","z","Transport","TransportConfigSchema","ZodLiteral","ZodEnum","ZodOptional","core","$strip","ZodObject","ZodString","ZodNumber","ZodDiscriminatedUnion","type","format","json","pretty","simple","path","maxSize","maxFiles","url","username","password","indexPrefix","bufferSize","flushInterval","brokerUrl","queue","LoggerConfigSchema","ZodArray","ZodBoolean","ZodDefault","level","debug","info","warn","error","fatal","transports","includeStack","TransportConfig","infer","LoggerConfig","LogContext","sessionId","driver","requestId","schemaId","traceId","spanId","isolateId","colo","doId","key","LogEvent","timestamp","message","component","name","stack","code","context","LogLevel","rootLogger","Logger","instance","LoggerInterface","meta","child","withContext","setLevel","createLogger","defaultContext","SanitizationRule","RegExp","pattern","strategy","options","keepChars","replacement","Sanitizer","rules","constructor","customRules","sanitize","findRule","applyRule","hash","sanitizeLogContext","createSanitizer","censorEmail","email","censorPhone","phone","censorWid","wid","censorToken","token","visibleChars","censorMessageBody","body","maxLength","censorObject","T","Record","obj","fields","GET_MATCH_RESULT","ParamIndexMap","ParamStash","Params","Result","RequestHeader","ResponseHeader","CustomHeader","InfoStatusCode","SuccessStatusCode","DeprecatedStatusCode","RedirectStatusCode","ClientErrorStatusCode","ServerErrorStatusCode","UnofficialStatusCode","StatusCode","ContentlessStatusCode","ContentfulStatusCode","Exclude","UnionToIntersection","U","k","I","JSONPrimitive","JSONArray","JSONObject","InvalidJSONValue","args","InvalidToNull","IsInvalid","OmitSymbolKeys","K","JSONValue","JSONParsed","TError","ReadonlyArray","J","Set","Map","toJSON","Simplify","KeyType","IsAny","Bindings","Variables","Env","Next","Promise","Input","ResponseFormat","in","out","outputFormat","BlankInput","RouterRoute","H","basePath","method","handler","HandlerResponse","O","Response","TypedResponse","Handler","E","P","R","Context","c","next","MiddlewareHandler","NotFoundResponse","NotFoundHandler","KnownResponseFormat","F","_data","_status","_format","FormValue","Blob","ParsedFormValue","File","ValidationTargets","form","query","param","_","header","cookie","ParamKey","Component","Name","NameWithPattern","Rest","_Pattern","ParamKeys","Path","ParamKeyToRecord","InputToDataByTarget","Target","RemoveQuestion","FetchEventLike","Request","request","respondWith","promise","passThroughOnException","waitUntil","BodyDataValueDot","x","BodyDataValueDotAll","SimplifyBodyData","BodyDataValueComponent","all","BodyDataValueObject","BodyDataValue","dot","BodyData","ParseBodyOptions","Partial","Body","ArrayBuffer","FormData","text","arrayBuffer","blob","formData","BodyCache","HonoRequest","P2","Options","raw","routeIndex","bodyCache","matchResult","queries","parseBody","addValidatedData","target","data","valid","matchedRoutes","routePath","BaseMime","_baseMimes","aac","avi","avif","av1","bin","bmp","css","csv","eot","epub","gif","gz","htm","html","ico","ics","jpeg","jpg","js","jsonld","map","mid","midi","mjs","mp3","mp4","mpeg","oga","ogv","ogx","opus","otf","pdf","png","rtf","svg","tif","tiff","ts","ttf","txt","wasm","webm","weba","webmanifest","webp","woff","woff2","xhtml","xml","zip","gltf","glb","HeaderRecord","Data","ReadableStream","Uint8Array","ExecutionContext","props","exports","ContextVariableMap","ContextRenderer","DefaultRenderer","content","Renderer","Function","PropsForRenderer","Parameters","Required","Props","Layout","Get","Key","Set$1","value","NewResponse","ResponseOrInit","status","headers","init","BodyRespond","TextRespond","JSONRespond","JSONRespondReturn","object","HTMLRespond","ContextOptions","env","executionCtx","notFoundHandler","SetHeadersOptions","append","SetHeaders","ResponseHeadersInit","Headers","ResponseInit","statusText","Error","Readonly","URL","ReturnType","finalized","req","event","res","_res","render","setLayout","layout","getLayout","setRenderer","renderer","set","get","var","newResponse","redirect","location","notFound","honoLogger","banner_d_exports","BannerOptions","show","showProjectBanner","version","subtitle","color","title","spinner_d_exports","fail","start","stop","succeed","update","animated_d_exports","ProgressLogger","ProgressOptions","total","label","current","done","index_d_exports","animated","banner","spinner","createConsoleTransport","Extract","transport","config","createFileTransport","createElasticsearchTransport","createMQTransport","createCloudflareTransport","index_d_exports$1","createTransport","cloudflare","console","elasticsearch","file","mq","terminal"],"sources":["../src/plugin.ts","../src/config.ts","../../../packages/logger/dist/index.d.cts","../src/deliverer.ts"],"mappings":";;;;cASM,YAAA,EAAY,CAAA,CAAA,SAAA;;;;;;;;;KAuBN,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,YAAA;AAAA,cAAc,QAAA;;;;;;;;;;;UC3B9C,aAAA;EAEf,GAAA;EAGA,MAAA;EAGA,WAAA;EAGA,OAAA;EAGA,UAAA;EAGA,OAAA,GAAU,MAAA;EAGV,OAAA;AAAA;AAAA,UAGe,OAAA;EACf,EAAA;EACA,GAAA;EACA,MAAA;EACA,OAAA,GAAU,MAAA;EACV,SAAA;AAAA;AAAA,UAGe,cAAA;EACf,SAAA;EACA,SAAA;EACA,KAAA;EACA,OAAA;EACA,SAAA;AAAA;;;;;UCsCQ4C,UAAAA;EACRC,SAAAA;EACAC,MAAAA;EACAC,SAAAA;EACAC,QAAAA;EACA,aAAA;EACA,WAAA;EACA,iBAAA;EACA,gBAAA;EACAC,OAAAA;EACAC,MAAAA;EACAC,SAAAA;EACAC,IAAAA;EACAC,IAAAA;EAAAA,CACCC,GAAAA;AAAAA;AAAAA;AAAAA;AAAAA,KAiBES,QAAAA;AAAAA;AAAAA,UAMKI,eAAAA;EACRjC,KAAAA,CAAMuB,OAAAA,UAAiBW,IAAAA,GAAOxB,UAAAA;EAC9BT,IAAAA,CAAKsB,OAAAA,UAAiBW,IAAAA,GAAOxB,UAAAA;EAC7BR,IAAAA,CAAKqB,OAAAA,UAAiBW,IAAAA,GAAOxB,UAAAA;EAC7BP,KAAAA,CAAMoB,OAAAA,UAAiBW,IAAAA,GAAOxB,UAAAA;IAC5BP,KAAAA;EAAAA;EAEFC,KAAAA,CAAMmB,OAAAA,UAAiBW,IAAAA,GAAOxB,UAAAA;IAC5BP,KAAAA;EAAAA;EAEFgC,KAAAA,CAAMP,OAAAA,EAASlB,UAAAA,GAAauB,eAAAA;EAC5BG,WAAAA,CAAYR,OAAAA,EAASlB,UAAAA,GAAauB,eAAAA;EAClCI,QAAAA,CAAStC,KAAAA,EAAO8B,QAAAA;AAAAA;AAAAA,KAKbE,MAAAA,GAASE,eAAAA;AAAAA;;;cC7HD,gBAAA;EAAA,iBACM,MAAA;EAAA,iBACA,MAAA;EAAA,iBACA,KAAA;EAAA,iBACA,OAAA;EAAA,iBACA,UAAA;EAAA,iBACA,OAAA;cAEL,MAAA,EAAQ,aAAA,EAAe,MAAA,EAAQ,MAAA;EAWrC,OAAA,CAAQ,OAAA,EAAS,cAAA,GAAiB,OAAA;EAAA,QAI1B,aAAA;EAAA,QA0CN,KAAA;EAIF,WAAA,CAAA,GAAe,OAAA;AAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,99 @@
1
+ import { createPlugin, z } from "@open-wa/plugin-sdk";
2
+ import PQueue from "p-queue";
3
+ //#region src/deliverer.ts
4
+ /**
5
+ * Webhook Deliverer — uses native fetch instead of axios.
6
+ * Supports exponential backoff retry and concurrent delivery via PQueue.
7
+ */
8
+ var WebhookDeliverer = class {
9
+ constructor(config, logger) {
10
+ this.config = config;
11
+ this.logger = logger;
12
+ this.retries = config.retries ?? 3;
13
+ this.retryDelay = config.retryDelay ?? 1e3;
14
+ this.timeout = config.timeout ?? 3e4;
15
+ this.queue = new PQueue({ concurrency: config.concurrency ?? 10 });
16
+ }
17
+ async deliver(payload) {
18
+ await this.queue.add(() => this.sendWithRetry(payload));
19
+ }
20
+ async sendWithRetry(payload, attempt = 0) {
21
+ try {
22
+ const controller = new AbortController();
23
+ const timeoutId = setTimeout(() => controller.abort(), this.timeout);
24
+ try {
25
+ const response = await fetch(this.config.url, {
26
+ method: "POST",
27
+ headers: {
28
+ "Content-Type": "application/json",
29
+ ...this.config.headers
30
+ },
31
+ body: JSON.stringify(payload),
32
+ signal: controller.signal
33
+ });
34
+ if (!response.ok) throw new Error(`HTTP ${response.status}: ${response.statusText}`);
35
+ this.logger.debug(`Webhook delivered: ${payload.event} to ${this.config.url}`);
36
+ } finally {
37
+ clearTimeout(timeoutId);
38
+ }
39
+ } catch (error) {
40
+ const errMessage = error instanceof Error ? error.message : String(error);
41
+ if (attempt < this.retries) {
42
+ const delay = this.retryDelay * Math.pow(2, attempt);
43
+ this.logger.warn(`Webhook delivery failed (attempt ${attempt + 1}/${this.retries + 1}), retrying in ${delay}ms: ${errMessage}`);
44
+ await this.sleep(delay);
45
+ return this.sendWithRetry(payload, attempt + 1);
46
+ }
47
+ this.logger.error(`Webhook delivery failed after ${this.retries + 1} attempts: ${errMessage}`);
48
+ }
49
+ }
50
+ sleep(ms) {
51
+ return new Promise((resolve) => setTimeout(resolve, ms));
52
+ }
53
+ async waitForIdle() {
54
+ await this.queue.onIdle();
55
+ }
56
+ };
57
+ var plugin_default = createPlugin({
58
+ meta: {
59
+ name: "webhook",
60
+ version: "5.0.0-alpha.1",
61
+ description: "Forward WhatsApp events to an external URL via HTTP POST",
62
+ author: "Mohammed Shah <@smashah>"
63
+ },
64
+ configSchema: z.object({
65
+ url: z.string().url(),
66
+ events: z.union([z.array(z.string()), z.literal("all")]).default("all"),
67
+ concurrency: z.number().int().positive().default(10),
68
+ retries: z.number().int().min(0).default(3),
69
+ retryDelay: z.number().int().positive().default(1e3),
70
+ headers: z.record(z.string()).optional(),
71
+ timeout: z.number().int().positive().default(3e4)
72
+ }),
73
+ init: async ({ config, logger, sessionId }) => {
74
+ const webhookId = crypto.randomUUID();
75
+ const deliverer = new WebhookDeliverer(config, logger);
76
+ const allowedEvents = config.events === "all" ? null : new Set(config.events);
77
+ logger.info(`Webhook configured: ${config.url} (${config.events === "all" ? "all events" : `${config.events.length} events`})`);
78
+ return {
79
+ event: async ({ event, payload }) => {
80
+ if (allowedEvents && !allowedEvents.has(event)) return;
81
+ await deliverer.deliver({
82
+ webhookId,
83
+ sessionId,
84
+ event,
85
+ payload,
86
+ timestamp: Date.now()
87
+ });
88
+ },
89
+ dispose: async () => {
90
+ await deliverer.waitForIdle();
91
+ logger.info("Webhook deliverer queue drained");
92
+ }
93
+ };
94
+ }
95
+ });
96
+ //#endregion
97
+ export { WebhookDeliverer, plugin_default as default, plugin_default as webhookPlugin };
98
+
99
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/deliverer.ts","../src/plugin.ts"],"sourcesContent":["import PQueue from 'p-queue';\nimport type { Logger } from '@open-wa/logger';\nimport type { WebhookConfig, WebhookPayload } from './config.js';\n\n/**\n * Webhook Deliverer — uses native fetch instead of axios.\n * Supports exponential backoff retry and concurrent delivery via PQueue.\n */\nexport class WebhookDeliverer {\n private readonly config: WebhookConfig;\n private readonly logger: Logger;\n private readonly queue: PQueue;\n private readonly retries: number;\n private readonly retryDelay: number;\n private readonly timeout: number;\n\n constructor(config: WebhookConfig, logger: Logger) {\n this.config = config;\n this.logger = logger;\n this.retries = config.retries ?? 3;\n this.retryDelay = config.retryDelay ?? 1000;\n this.timeout = config.timeout ?? 30_000;\n this.queue = new PQueue({\n concurrency: config.concurrency ?? 10,\n });\n }\n\n async deliver(payload: WebhookPayload): Promise<void> {\n await this.queue.add(() => this.sendWithRetry(payload));\n }\n\n private async sendWithRetry(payload: WebhookPayload, attempt = 0): Promise<void> {\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeout);\n\n try {\n const response = await fetch(this.config.url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...this.config.headers,\n },\n body: JSON.stringify(payload),\n signal: controller.signal,\n });\n\n if (!response.ok) {\n throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n }\n\n this.logger.debug(`Webhook delivered: ${payload.event} to ${this.config.url}`);\n } finally {\n clearTimeout(timeoutId);\n }\n } catch (error) {\n const errMessage = error instanceof Error ? error.message : String(error);\n\n if (attempt < this.retries) {\n const delay = this.retryDelay * Math.pow(2, attempt);\n this.logger.warn(\n `Webhook delivery failed (attempt ${attempt + 1}/${this.retries + 1}), retrying in ${delay}ms: ${errMessage}`\n );\n await this.sleep(delay);\n return this.sendWithRetry(payload, attempt + 1);\n }\n\n this.logger.error(\n `Webhook delivery failed after ${this.retries + 1} attempts: ${errMessage}`\n );\n }\n }\n\n private sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }\n\n async waitForIdle(): Promise<void> {\n await this.queue.onIdle();\n }\n}\n","/**\n * Webhook Integration Plugin\n *\n * Forwards public WA events to an external URL via HTTP POST.\n * Supports event filtering, retry with exponential backoff, and concurrent delivery.\n */\nimport { createPlugin, z } from '@open-wa/plugin-sdk';\nimport { WebhookDeliverer } from './deliverer.js';\n\nconst configSchema = z.object({\n /** Target URL for webhook delivery */\n url: z.string().url(),\n\n /** Which events to forward. Use 'all' to forward everything. */\n events: z.union([z.array(z.string()), z.literal('all')]).default('all'),\n\n /** Max concurrent deliveries */\n concurrency: z.number().int().positive().default(10),\n\n /** Number of retry attempts */\n retries: z.number().int().min(0).default(3),\n\n /** Base retry delay in ms */\n retryDelay: z.number().int().positive().default(1000),\n\n /** Additional headers */\n headers: z.record(z.string()).optional(),\n\n /** Request timeout in ms */\n timeout: z.number().int().positive().default(30_000),\n});\n\nexport type WebhookPluginConfig = z.infer<typeof configSchema>;\n\nexport default createPlugin({\n meta: {\n name: 'webhook',\n version: '5.0.0-alpha.1',\n description: 'Forward WhatsApp events to an external URL via HTTP POST',\n author: 'Mohammed Shah <@smashah>',\n },\n\n configSchema,\n\n init: async ({ config, logger, sessionId }) => {\n const webhookId = crypto.randomUUID();\n const deliverer = new WebhookDeliverer(config, logger);\n\n const allowedEvents = config.events === 'all'\n ? null\n : new Set(config.events);\n\n logger.info(`Webhook configured: ${config.url} (${config.events === 'all' ? 'all events' : `${(config.events as string[]).length} events`})`);\n\n return {\n event: async ({ event, payload }) => {\n if (allowedEvents && !allowedEvents.has(event)) {\n return;\n }\n\n await deliverer.deliver({\n webhookId,\n sessionId,\n event,\n payload,\n timestamp: Date.now(),\n });\n },\n\n dispose: async () => {\n await deliverer.waitForIdle();\n logger.info('Webhook deliverer queue drained');\n },\n };\n },\n});\n"],"mappings":"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"}
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@open-wa/integration-webhook",
3
+ "version": "5.0.0-alpha.0",
4
+ "description": "Webhook delivery integration plugin for open-wa",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./dist/index.mjs",
9
+ "types": "./dist/index.d.mts"
10
+ }
11
+ },
12
+ "dependencies": {
13
+ "p-queue": "^8.0.0",
14
+ "@open-wa/plugin-sdk": "5.0.0-alpha.0"
15
+ },
16
+ "devDependencies": {
17
+ "@types/node": "^25.9.1",
18
+ "typescript": "^6.0.3",
19
+ "@open-wa/logger": "5.0.0-alpha.0"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/open-wa/wa-automate-nodejs.git"
27
+ },
28
+ "scripts": {
29
+ "build": "tsdown src/index.ts --format esm --dts",
30
+ "dev": "tsdown src/index.ts --format esm --dts --watch",
31
+ "lint": "oxlint src",
32
+ "clean": "rimraf dist"
33
+ }
34
+ }
package/src/config.ts ADDED
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Webhook configuration types.
3
+ * No longer depends on AxiosRequestConfig — uses native fetch options.
4
+ */
5
+
6
+ export interface WebhookConfig {
7
+ /** Target URL for webhook delivery */
8
+ url: string;
9
+
10
+ /** Which events to forward. 'all' or an array of event names. */
11
+ events?: string[] | 'all';
12
+
13
+ /** Max concurrent deliveries (default: 10) */
14
+ concurrency?: number;
15
+
16
+ /** Number of retry attempts (default: 3) */
17
+ retries?: number;
18
+
19
+ /** Base retry delay in ms, exponentially backed off (default: 1000) */
20
+ retryDelay?: number;
21
+
22
+ /** Additional headers to send with each webhook request */
23
+ headers?: Record<string, string>;
24
+
25
+ /** Request timeout in ms (default: 30000) */
26
+ timeout?: number;
27
+ }
28
+
29
+ export interface Webhook {
30
+ id: string;
31
+ url: string;
32
+ events: string[];
33
+ headers?: Record<string, string>;
34
+ createdAt: number;
35
+ }
36
+
37
+ export interface WebhookPayload {
38
+ webhookId: string;
39
+ sessionId: string;
40
+ event: string;
41
+ payload: unknown;
42
+ timestamp: number;
43
+ }
@@ -0,0 +1,81 @@
1
+ import PQueue from 'p-queue';
2
+ import type { Logger } from '@open-wa/logger';
3
+ import type { WebhookConfig, WebhookPayload } from './config.js';
4
+
5
+ /**
6
+ * Webhook Deliverer — uses native fetch instead of axios.
7
+ * Supports exponential backoff retry and concurrent delivery via PQueue.
8
+ */
9
+ export class WebhookDeliverer {
10
+ private readonly config: WebhookConfig;
11
+ private readonly logger: Logger;
12
+ private readonly queue: PQueue;
13
+ private readonly retries: number;
14
+ private readonly retryDelay: number;
15
+ private readonly timeout: number;
16
+
17
+ constructor(config: WebhookConfig, logger: Logger) {
18
+ this.config = config;
19
+ this.logger = logger;
20
+ this.retries = config.retries ?? 3;
21
+ this.retryDelay = config.retryDelay ?? 1000;
22
+ this.timeout = config.timeout ?? 30_000;
23
+ this.queue = new PQueue({
24
+ concurrency: config.concurrency ?? 10,
25
+ });
26
+ }
27
+
28
+ async deliver(payload: WebhookPayload): Promise<void> {
29
+ await this.queue.add(() => this.sendWithRetry(payload));
30
+ }
31
+
32
+ private async sendWithRetry(payload: WebhookPayload, attempt = 0): Promise<void> {
33
+ try {
34
+ const controller = new AbortController();
35
+ const timeoutId = setTimeout(() => controller.abort(), this.timeout);
36
+
37
+ try {
38
+ const response = await fetch(this.config.url, {
39
+ method: 'POST',
40
+ headers: {
41
+ 'Content-Type': 'application/json',
42
+ ...this.config.headers,
43
+ },
44
+ body: JSON.stringify(payload),
45
+ signal: controller.signal,
46
+ });
47
+
48
+ if (!response.ok) {
49
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
50
+ }
51
+
52
+ this.logger.debug(`Webhook delivered: ${payload.event} to ${this.config.url}`);
53
+ } finally {
54
+ clearTimeout(timeoutId);
55
+ }
56
+ } catch (error) {
57
+ const errMessage = error instanceof Error ? error.message : String(error);
58
+
59
+ if (attempt < this.retries) {
60
+ const delay = this.retryDelay * Math.pow(2, attempt);
61
+ this.logger.warn(
62
+ `Webhook delivery failed (attempt ${attempt + 1}/${this.retries + 1}), retrying in ${delay}ms: ${errMessage}`
63
+ );
64
+ await this.sleep(delay);
65
+ return this.sendWithRetry(payload, attempt + 1);
66
+ }
67
+
68
+ this.logger.error(
69
+ `Webhook delivery failed after ${this.retries + 1} attempts: ${errMessage}`
70
+ );
71
+ }
72
+ }
73
+
74
+ private sleep(ms: number): Promise<void> {
75
+ return new Promise((resolve) => setTimeout(resolve, ms));
76
+ }
77
+
78
+ async waitForIdle(): Promise<void> {
79
+ await this.queue.onIdle();
80
+ }
81
+ }
package/src/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ // Default export is the plugin itself (for config-driven loading)
2
+ export { default, default as webhookPlugin } from './plugin.js';
3
+ export type { WebhookPluginConfig } from './plugin.js';
4
+
5
+ // Named exports for direct usage
6
+ export type { WebhookConfig, Webhook, WebhookPayload } from './config.js';
7
+ export { WebhookDeliverer } from './deliverer.js';
package/src/plugin.ts ADDED
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Webhook Integration Plugin
3
+ *
4
+ * Forwards public WA events to an external URL via HTTP POST.
5
+ * Supports event filtering, retry with exponential backoff, and concurrent delivery.
6
+ */
7
+ import { createPlugin, z } from '@open-wa/plugin-sdk';
8
+ import { WebhookDeliverer } from './deliverer.js';
9
+
10
+ const configSchema = z.object({
11
+ /** Target URL for webhook delivery */
12
+ url: z.string().url(),
13
+
14
+ /** Which events to forward. Use 'all' to forward everything. */
15
+ events: z.union([z.array(z.string()), z.literal('all')]).default('all'),
16
+
17
+ /** Max concurrent deliveries */
18
+ concurrency: z.number().int().positive().default(10),
19
+
20
+ /** Number of retry attempts */
21
+ retries: z.number().int().min(0).default(3),
22
+
23
+ /** Base retry delay in ms */
24
+ retryDelay: z.number().int().positive().default(1000),
25
+
26
+ /** Additional headers */
27
+ headers: z.record(z.string()).optional(),
28
+
29
+ /** Request timeout in ms */
30
+ timeout: z.number().int().positive().default(30_000),
31
+ });
32
+
33
+ export type WebhookPluginConfig = z.infer<typeof configSchema>;
34
+
35
+ export default createPlugin({
36
+ meta: {
37
+ name: 'webhook',
38
+ version: '5.0.0-alpha.1',
39
+ description: 'Forward WhatsApp events to an external URL via HTTP POST',
40
+ author: 'Mohammed Shah <@smashah>',
41
+ },
42
+
43
+ configSchema,
44
+
45
+ init: async ({ config, logger, sessionId }) => {
46
+ const webhookId = crypto.randomUUID();
47
+ const deliverer = new WebhookDeliverer(config, logger);
48
+
49
+ const allowedEvents = config.events === 'all'
50
+ ? null
51
+ : new Set(config.events);
52
+
53
+ logger.info(`Webhook configured: ${config.url} (${config.events === 'all' ? 'all events' : `${(config.events as string[]).length} events`})`);
54
+
55
+ return {
56
+ event: async ({ event, payload }) => {
57
+ if (allowedEvents && !allowedEvents.has(event)) {
58
+ return;
59
+ }
60
+
61
+ await deliverer.deliver({
62
+ webhookId,
63
+ sessionId,
64
+ event,
65
+ payload,
66
+ timestamp: Date.now(),
67
+ });
68
+ },
69
+
70
+ dispose: async () => {
71
+ await deliverer.waitForIdle();
72
+ logger.info('Webhook deliverer queue drained');
73
+ },
74
+ };
75
+ },
76
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist"
6
+ },
7
+ "include": ["src/**/*.ts"],
8
+ "exclude": ["node_modules", "dist"]
9
+ }