@dudousxd/nestjs-notifications-webhook 0.2.0 → 0.3.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.
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/tokens.d.ts +2 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +3 -1
- package/dist/tokens.js.map +1 -1
- package/dist/webhook.channel.d.ts +6 -3
- package/dist/webhook.channel.d.ts.map +1 -1
- package/dist/webhook.channel.js +13 -8
- package/dist/webhook.channel.js.map +1 -1
- package/dist/webhook.module.d.ts +6 -0
- package/dist/webhook.module.d.ts.map +1 -1
- package/dist/webhook.module.js +1 -0
- package/dist/webhook.module.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { WebhookMessage, type WebhookMethod, type WebhookRequest, } from './webhook-message';
|
|
2
|
-
export { Webhook, WebhookChannel, type WebhookChannelOptions, type WebhookNotification, } from './webhook.channel';
|
|
2
|
+
export { Webhook, WebhookChannel, type WebhookChannelOptions, type WebhookNotification, type WebhookOptionsResolver, } from './webhook.channel';
|
|
3
3
|
export { WebhookChannelModule, type WebhookChannelModuleOptions, } from './webhook.module';
|
|
4
|
-
export { WEBHOOK_OPTIONS } from './tokens';
|
|
4
|
+
export { WEBHOOK_OPTIONS, WEBHOOK_OPTIONS_RESOLVER } from './tokens';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,OAAO,EACP,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,OAAO,EACP,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oBAAoB,EACpB,KAAK,2BAA2B,GACjC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WEBHOOK_OPTIONS = exports.WebhookChannelModule = exports.WebhookChannel = exports.Webhook = exports.WebhookMessage = void 0;
|
|
3
|
+
exports.WEBHOOK_OPTIONS_RESOLVER = exports.WEBHOOK_OPTIONS = exports.WebhookChannelModule = exports.WebhookChannel = exports.Webhook = exports.WebhookMessage = void 0;
|
|
4
4
|
var webhook_message_1 = require("./webhook-message");
|
|
5
5
|
Object.defineProperty(exports, "WebhookMessage", { enumerable: true, get: function () { return webhook_message_1.WebhookMessage; } });
|
|
6
6
|
var webhook_channel_1 = require("./webhook.channel");
|
|
@@ -10,4 +10,5 @@ var webhook_module_1 = require("./webhook.module");
|
|
|
10
10
|
Object.defineProperty(exports, "WebhookChannelModule", { enumerable: true, get: function () { return webhook_module_1.WebhookChannelModule; } });
|
|
11
11
|
var tokens_1 = require("./tokens");
|
|
12
12
|
Object.defineProperty(exports, "WEBHOOK_OPTIONS", { enumerable: true, get: function () { return tokens_1.WEBHOOK_OPTIONS; } });
|
|
13
|
+
Object.defineProperty(exports, "WEBHOOK_OPTIONS_RESOLVER", { enumerable: true, get: function () { return tokens_1.WEBHOOK_OPTIONS_RESOLVER; } });
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAI2B;AAHzB,iHAAA,cAAc,OAAA;AAIhB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAI2B;AAHzB,iHAAA,cAAc,OAAA;AAIhB,qDAM2B;AALzB,0GAAA,OAAO,OAAA;AACP,iHAAA,cAAc,OAAA;AAKhB,mDAG0B;AAFxB,sHAAA,oBAAoB,OAAA;AAGtB,mCAAqE;AAA5D,yGAAA,eAAe,OAAA;AAAE,kHAAA,wBAAwB,OAAA"}
|
package/dist/tokens.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/** DI token for the resolved {@link WebhookChannelOptions} (default url, headers). */
|
|
2
2
|
export declare const WEBHOOK_OPTIONS: unique symbol;
|
|
3
|
+
/** DI token for the optional per-tenant {@link WebhookChannelOptions} resolver. */
|
|
4
|
+
export declare const WEBHOOK_OPTIONS_RESOLVER: unique symbol;
|
|
3
5
|
//# sourceMappingURL=tokens.d.ts.map
|
package/dist/tokens.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,eAAO,MAAM,eAAe,eAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,eAAO,MAAM,eAAe,eAA4B,CAAC;AAEzD,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,eAAqC,CAAC"}
|
package/dist/tokens.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WEBHOOK_OPTIONS = void 0;
|
|
3
|
+
exports.WEBHOOK_OPTIONS_RESOLVER = exports.WEBHOOK_OPTIONS = void 0;
|
|
4
4
|
/** DI token for the resolved {@link WebhookChannelOptions} (default url, headers). */
|
|
5
5
|
exports.WEBHOOK_OPTIONS = Symbol('WEBHOOK_OPTIONS');
|
|
6
|
+
/** DI token for the optional per-tenant {@link WebhookChannelOptions} resolver. */
|
|
7
|
+
exports.WEBHOOK_OPTIONS_RESOLVER = Symbol('WEBHOOK_OPTIONS_RESOLVER');
|
|
6
8
|
//# sourceMappingURL=tokens.js.map
|
package/dist/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":";;;AAAA,sFAAsF;AACzE,QAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":";;;AAAA,sFAAsF;AACzE,QAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEzD,mFAAmF;AACtE,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChannelDriver, type Notifiable, type Notification } from '@dudousxd/nestjs-notifications-core';
|
|
1
|
+
import { type ChannelDriver, type DeliveryContext, type Notifiable, type Notification } from '@dudousxd/nestjs-notifications-core';
|
|
2
2
|
import { WebhookMessage } from './webhook-message';
|
|
3
3
|
/** Channel handle: use as `@Webhook()` on a payload method, or as a token in `via()`. */
|
|
4
4
|
export declare const Webhook: import("@dudousxd/nestjs-notifications-core").ChannelHandle;
|
|
@@ -17,6 +17,8 @@ export interface WebhookChannelOptions {
|
|
|
17
17
|
export interface WebhookNotification extends Notification {
|
|
18
18
|
toWebhook(notifiable: Notifiable): WebhookMessage | Record<string, unknown>;
|
|
19
19
|
}
|
|
20
|
+
/** Resolves per-tenant {@link WebhookChannelOptions} from a tenant id. */
|
|
21
|
+
export type WebhookOptionsResolver = (tenant: string) => WebhookChannelOptions;
|
|
20
22
|
/**
|
|
21
23
|
* Delivers a notification by sending an HTTP request (JSON body) to a webhook endpoint.
|
|
22
24
|
* The target URL comes from the {@link WebhookMessage}, else from
|
|
@@ -24,9 +26,10 @@ export interface WebhookNotification extends Notification {
|
|
|
24
26
|
*/
|
|
25
27
|
export declare class WebhookChannel implements ChannelDriver {
|
|
26
28
|
private readonly options;
|
|
29
|
+
private readonly resolveOptions?;
|
|
27
30
|
readonly channel = "webhook";
|
|
28
|
-
constructor(options: WebhookChannelOptions);
|
|
29
|
-
send(notifiable: Notifiable, notification: Notification): Promise<void>;
|
|
31
|
+
constructor(options: WebhookChannelOptions, resolveOptions?: WebhookOptionsResolver | undefined);
|
|
32
|
+
send(notifiable: Notifiable, notification: Notification, context?: DeliveryContext): Promise<void>;
|
|
30
33
|
private post;
|
|
31
34
|
}
|
|
32
35
|
//# sourceMappingURL=webhook.channel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.channel.d.ts","sourceRoot":"","sources":["../src/webhook.channel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"webhook.channel.d.ts","sourceRoot":"","sources":["../src/webhook.channel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EAEpB,KAAK,UAAU,EACf,KAAK,YAAY,EAIlB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,yFAAyF;AACzF,eAAO,MAAM,OAAO,6DAA2B,CAAC;AAEhD,wDAAwD;AACxD,MAAM,WAAW,qBAAqB;IACpC,4EAA4E;IAC5E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,SAAS,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7E;AAED,0EAA0E;AAC1E,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,qBAAqB,CAAC;AAE/E;;;;GAIG;AACH,qBACa,cAAe,YAAW,aAAa;IAKhD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAGxB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAPlC,QAAQ,CAAC,OAAO,aAAa;gBAIV,OAAO,EAAE,qBAAqB,EAG9B,cAAc,CAAC,EAAE,sBAAsB,YAAA;IAGpD,IAAI,CACR,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC;YA8BF,IAAI;CAuBnB"}
|
package/dist/webhook.channel.js
CHANGED
|
@@ -26,11 +26,14 @@ exports.Webhook = (0, nestjs_notifications_core_1.createChannel)('webhook');
|
|
|
26
26
|
*/
|
|
27
27
|
let WebhookChannel = class WebhookChannel {
|
|
28
28
|
options;
|
|
29
|
+
resolveOptions;
|
|
29
30
|
channel = 'webhook';
|
|
30
|
-
constructor(options) {
|
|
31
|
+
constructor(options, resolveOptions) {
|
|
31
32
|
this.options = options;
|
|
33
|
+
this.resolveOptions = resolveOptions;
|
|
32
34
|
}
|
|
33
|
-
async send(notifiable, notification) {
|
|
35
|
+
async send(notifiable, notification, context) {
|
|
36
|
+
const options = context?.tenant && this.resolveOptions ? this.resolveOptions(context.tenant) : this.options;
|
|
34
37
|
const handler = (0, nestjs_notifications_core_1.getHandler)(notification, 'webhook', 'toWebhook');
|
|
35
38
|
if (!handler) {
|
|
36
39
|
const name = notification.constructor.notificationName ??
|
|
@@ -40,17 +43,17 @@ let WebhookChannel = class WebhookChannel {
|
|
|
40
43
|
const result = handler(notifiable);
|
|
41
44
|
const message = result instanceof webhook_message_1.WebhookMessage ? result : new webhook_message_1.WebhookMessage().payload(result);
|
|
42
45
|
const request = message.toRequest();
|
|
43
|
-
const route =
|
|
44
|
-
const url = request.url ?? (typeof route === 'string' ? route : undefined) ??
|
|
46
|
+
const route = (0, nestjs_notifications_core_1.routeFor)(notifiable, 'webhook', notification);
|
|
47
|
+
const url = request.url ?? (typeof route === 'string' ? route : undefined) ?? options.url;
|
|
45
48
|
if (!url) {
|
|
46
49
|
throw new Error('The webhook channel needs a target URL. Set one on the WebhookMessage via .url(), ' +
|
|
47
50
|
'return one from routeNotificationFor("webhook"), or set url in forRoot().');
|
|
48
51
|
}
|
|
49
|
-
await this.post(url, request.method, request.body, request.headers);
|
|
52
|
+
await this.post(options, url, request.method, request.body, request.headers);
|
|
50
53
|
}
|
|
51
|
-
async post(url, method, body, messageHeaders) {
|
|
54
|
+
async post(options, url, method, body, messageHeaders) {
|
|
52
55
|
const headers = {
|
|
53
|
-
...
|
|
56
|
+
...options.headers,
|
|
54
57
|
...messageHeaders,
|
|
55
58
|
'Content-Type': 'application/json',
|
|
56
59
|
};
|
|
@@ -68,6 +71,8 @@ exports.WebhookChannel = WebhookChannel;
|
|
|
68
71
|
exports.WebhookChannel = WebhookChannel = __decorate([
|
|
69
72
|
(0, common_1.Injectable)(),
|
|
70
73
|
__param(0, (0, common_1.Inject)(tokens_1.WEBHOOK_OPTIONS)),
|
|
71
|
-
|
|
74
|
+
__param(1, (0, common_1.Optional)()),
|
|
75
|
+
__param(1, (0, common_1.Inject)(tokens_1.WEBHOOK_OPTIONS_RESOLVER)),
|
|
76
|
+
__metadata("design:paramtypes", [Object, Function])
|
|
72
77
|
], WebhookChannel);
|
|
73
78
|
//# sourceMappingURL=webhook.channel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.channel.js","sourceRoot":"","sources":["../src/webhook.channel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"webhook.channel.js","sourceRoot":"","sources":["../src/webhook.channel.ts"],"names":[],"mappings":"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"}
|
package/dist/webhook.module.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { type DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { type WebhookOptionsResolver } from './webhook.channel';
|
|
2
3
|
export interface WebhookChannelModuleOptions {
|
|
3
4
|
/** Default URL used when neither the message nor the route supplies one. */
|
|
4
5
|
url?: string;
|
|
5
6
|
/** Default headers merged into every request. */
|
|
6
7
|
headers?: Record<string, string>;
|
|
8
|
+
/**
|
|
9
|
+
* Optional per-tenant options resolver. When a notification is delivered with a
|
|
10
|
+
* `context.tenant`, the returned options are used instead of the defaults.
|
|
11
|
+
*/
|
|
12
|
+
resolveOptions?: WebhookOptionsResolver;
|
|
7
13
|
/** Register globally so the channel is discoverable app-wide. Default true. */
|
|
8
14
|
global?: boolean;
|
|
9
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.module.d.ts","sourceRoot":"","sources":["../src/webhook.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"webhook.module.d.ts","sourceRoot":"","sources":["../src/webhook.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,gBAAgB,CAAC;AAE3E,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,2BAA2B;IAC1C,4EAA4E;IAC5E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC,+EAA+E;IAC/E,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,qBACa,oBAAoB;IAC/B,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,2BAAgC,GAAG,aAAa;CAmBzE"}
|
package/dist/webhook.module.js
CHANGED
|
@@ -26,6 +26,7 @@ let WebhookChannelModule = WebhookChannelModule_1 = class WebhookChannelModule {
|
|
|
26
26
|
};
|
|
27
27
|
const providers = [
|
|
28
28
|
{ provide: tokens_1.WEBHOOK_OPTIONS, useValue: webhookOptions },
|
|
29
|
+
{ provide: tokens_1.WEBHOOK_OPTIONS_RESOLVER, useValue: options.resolveOptions ?? null },
|
|
29
30
|
webhook_channel_1.WebhookChannel,
|
|
30
31
|
];
|
|
31
32
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.module.js","sourceRoot":"","sources":["../src/webhook.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA2E;AAC3E,
|
|
1
|
+
{"version":3,"file":"webhook.module.js","sourceRoot":"","sources":["../src/webhook.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA2E;AAC3E,qCAAqE;AACrE,uDAI2B;AAgB3B;;;;;;GAMG;AAEI,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAC/B,MAAM,CAAC,OAAO,CAAC,UAAuC,EAAE;QACtD,MAAM,cAAc,GAA0B;YAC5C,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC;QAEF,MAAM,SAAS,GAAe;YAC5B,EAAE,OAAO,EAAE,wBAAe,EAAE,QAAQ,EAAE,cAAc,EAAE;YACtD,EAAE,OAAO,EAAE,iCAAwB,EAAE,QAAQ,EAAE,OAAO,CAAC,cAAc,IAAI,IAAI,EAAE;YAC/E,gCAAc;SACf,CAAC;QAEF,OAAO;YACL,MAAM,EAAE,sBAAoB;YAC5B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI;YAC9B,SAAS;YACT,OAAO,EAAE,CAAC,gCAAc,CAAC;SAC1B,CAAC;IACJ,CAAC;CACF,CAAA;AApBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,oBAAoB,CAoBhC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dudousxd/nestjs-notifications-webhook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Webhook channel for nestjs-notifications — deliver notifications by POSTing JSON to an HTTP endpoint",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Davide Carvalho",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@nestjs/common": "^11.0.0",
|
|
24
24
|
"reflect-metadata": "^0.2.2",
|
|
25
25
|
"typescript": "^5.7.2",
|
|
26
|
-
"@dudousxd/nestjs-notifications-core": "^0.
|
|
26
|
+
"@dudousxd/nestjs-notifications-core": "^0.4.0"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsc -p tsconfig.json",
|