@decaf-ts/for-nest 0.10.2 → 0.11.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/README.md +1 -1
- package/dist/for-nest.cjs +1 -1
- package/dist/for-nest.cjs.map +1 -1
- package/dist/for-nest.js +1 -1
- package/dist/for-nest.js.map +1 -1
- package/lib/cjs/index.cjs +4 -3
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/webhooks/DecafWebhookModule.cjs +141 -0
- package/lib/cjs/webhooks/DecafWebhookModule.cjs.map +1 -0
- package/lib/cjs/webhooks/controllers.cjs +151 -0
- package/lib/cjs/webhooks/controllers.cjs.map +1 -0
- package/lib/cjs/webhooks/index.cjs +34 -0
- package/lib/cjs/webhooks/index.cjs.map +1 -0
- package/lib/cjs/webhooks/types.cjs +4 -0
- package/lib/cjs/webhooks/types.cjs.map +1 -0
- package/lib/esm/index.js +4 -3
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/webhooks/DecafWebhookModule.js +132 -0
- package/lib/esm/webhooks/DecafWebhookModule.js.map +1 -0
- package/lib/esm/webhooks/controllers.js +142 -0
- package/lib/esm/webhooks/controllers.js.map +1 -0
- package/lib/esm/webhooks/index.js +5 -0
- package/lib/esm/webhooks/index.js.map +1 -0
- package/lib/esm/webhooks/types.js +2 -0
- package/lib/esm/webhooks/types.js.map +1 -0
- package/lib/types/index.d.cts +4 -3
- package/lib/types/index.d.mts +4 -3
- package/lib/types/webhooks/DecafWebhookModule.d.cts +13 -0
- package/lib/types/webhooks/DecafWebhookModule.d.mts +13 -0
- package/lib/types/webhooks/controllers.d.cts +13 -0
- package/lib/types/webhooks/controllers.d.mts +13 -0
- package/lib/types/webhooks/index.d.cts +4 -0
- package/lib/types/webhooks/index.d.mts +4 -0
- package/lib/types/webhooks/types.d.cts +21 -0
- package/lib/types/webhooks/types.d.mts +21 -0
- package/package.json +13 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DecafWebhooksModule = exports.DecafWebhookModule = void 0;
|
|
4
|
+
exports.runWebhooksMigrations = runWebhooksMigrations;
|
|
5
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
6
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
8
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
+
else
|
|
10
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
11
|
+
if (d = decorators[i])
|
|
12
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
|
+
};
|
|
15
|
+
var DecafWebhookModule_1;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const core_1 = require("@nestjs/core");
|
|
18
|
+
const core_2 = require("@decaf-ts/core");
|
|
19
|
+
const db_decorators_1 = require("@decaf-ts/db-decorators");
|
|
20
|
+
const decoration_1 = require("@decaf-ts/decoration");
|
|
21
|
+
const logging_1 = require("@decaf-ts/logging");
|
|
22
|
+
const index_js_1 = require("./../request/index.cjs");
|
|
23
|
+
const DecafHandlerExecutor_js_1 = require("./../request/DecafHandlerExecutor.cjs");
|
|
24
|
+
const DecafRequestHandlerInterceptor_js_1 = require("./../interceptors/DecafRequestHandlerInterceptor.cjs");
|
|
25
|
+
const constants_js_1 = require("./../constants.cjs");
|
|
26
|
+
const core_3 = require("@nestjs/core");
|
|
27
|
+
const index_js_2 = require("./../decaf-model/index.cjs");
|
|
28
|
+
const context_js_1 = require("./../interceptors/context.cjs");
|
|
29
|
+
const server_1 = require("@decaf-ts/for-http/server");
|
|
30
|
+
const controllers_js_1 = require("./controllers.cjs");
|
|
31
|
+
let DecafWebhookModule = class DecafWebhookModule {
|
|
32
|
+
static { DecafWebhookModule_1 = this; }
|
|
33
|
+
static { this._logger = logging_1.Logging.for(DecafWebhookModule_1); }
|
|
34
|
+
static get log() {
|
|
35
|
+
return this._logger;
|
|
36
|
+
}
|
|
37
|
+
static async bootPersistence(options) {
|
|
38
|
+
const log = this.log.for(this.bootPersistence);
|
|
39
|
+
if (!this._persistence) {
|
|
40
|
+
const trimmed = options.conf.map(([contr, cfg, ...args]) => {
|
|
41
|
+
const possible = args.pop();
|
|
42
|
+
if (!possible)
|
|
43
|
+
return [contr, cfg];
|
|
44
|
+
return [contr, cfg, ...args];
|
|
45
|
+
});
|
|
46
|
+
this._persistence = new core_2.PersistenceService();
|
|
47
|
+
await this._persistence.boot(trimmed);
|
|
48
|
+
const clients = this._persistence.client;
|
|
49
|
+
for (let i = 0; i < clients.length; i++) {
|
|
50
|
+
const cache = core_2.Adapter._cache || (core_2.Adapter._cache = {});
|
|
51
|
+
const webhookKeys = [
|
|
52
|
+
clients[i].flavour,
|
|
53
|
+
clients[i].alias,
|
|
54
|
+
"webhook_deliveries",
|
|
55
|
+
"webhook_events",
|
|
56
|
+
"webhook_subscriptions",
|
|
57
|
+
].filter((value) => !!value);
|
|
58
|
+
for (const key of webhookKeys) {
|
|
59
|
+
cache[key] = clients[i];
|
|
60
|
+
}
|
|
61
|
+
const c = options.conf[i];
|
|
62
|
+
const possibleTransf = c.slice(2, c.length);
|
|
63
|
+
let transformer = possibleTransf.pop();
|
|
64
|
+
if (!transformer ||
|
|
65
|
+
!transformer.from) {
|
|
66
|
+
const contr = core_2.Adapter.transformerFor(clients[i].flavour);
|
|
67
|
+
if (!contr)
|
|
68
|
+
throw new db_decorators_1.InternalError(`No transformer found for flavour ${clients[i].flavour}.`);
|
|
69
|
+
try {
|
|
70
|
+
transformer = contr.from
|
|
71
|
+
? contr
|
|
72
|
+
: new contr();
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
throw new db_decorators_1.InternalError(`Failed to boot transformer for ${clients[i].flavour}: ${e}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
(0, context_js_1.requestToContextTransformer)(clients[i].flavour)(transformer);
|
|
79
|
+
(0, decoration_1.uses)(clients[i].flavour)(server_1.WebhookSubscription);
|
|
80
|
+
(0, decoration_1.uses)(clients[i].flavour)(server_1.WebhookEventRecord);
|
|
81
|
+
(0, decoration_1.uses)(clients[i].flavour)(server_1.WebhookDelivery);
|
|
82
|
+
}
|
|
83
|
+
log.info("persistence layer created successfully!");
|
|
84
|
+
if (options.initialization) {
|
|
85
|
+
try {
|
|
86
|
+
await options.initialization();
|
|
87
|
+
}
|
|
88
|
+
catch (e) {
|
|
89
|
+
throw new db_decorators_1.InternalError(`Failed to initialize webhook module: ${e}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return this._persistence.client;
|
|
94
|
+
}
|
|
95
|
+
static async forRoot(options) {
|
|
96
|
+
return this.forRootAsync(options);
|
|
97
|
+
}
|
|
98
|
+
static async forRootAsync(options) {
|
|
99
|
+
const adapters = await this.bootPersistence(options);
|
|
100
|
+
const controllers = [
|
|
101
|
+
index_js_2.FromModelController.create(server_1.WebhookSubscription),
|
|
102
|
+
index_js_2.FromModelController.create(server_1.WebhookEventRecord),
|
|
103
|
+
index_js_2.FromModelController.create(server_1.WebhookDelivery),
|
|
104
|
+
controllers_js_1.WebhookSubscriptionActionsController,
|
|
105
|
+
controllers_js_1.WebhookEventActionsController,
|
|
106
|
+
];
|
|
107
|
+
return {
|
|
108
|
+
module: DecafWebhookModule_1,
|
|
109
|
+
controllers,
|
|
110
|
+
imports: [
|
|
111
|
+
core_1.RouterModule.register([
|
|
112
|
+
{
|
|
113
|
+
path: (options.webhookApiPath || "webhooks").replace(/^\//, ""),
|
|
114
|
+
module: DecafWebhookModule_1,
|
|
115
|
+
},
|
|
116
|
+
]),
|
|
117
|
+
],
|
|
118
|
+
providers: [
|
|
119
|
+
index_js_1.DecafRequestContext,
|
|
120
|
+
DecafHandlerExecutor_js_1.DecafHandlerExecutor,
|
|
121
|
+
{
|
|
122
|
+
provide: constants_js_1.DECAF_HANDLERS,
|
|
123
|
+
useFactory: () => options.handlers?.map((H) => new H()) ?? [],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
provide: core_3.APP_INTERCEPTOR,
|
|
127
|
+
useClass: DecafRequestHandlerInterceptor_js_1.DecafRequestHandlerInterceptor,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
exports: [index_js_1.DecafRequestContext, DecafHandlerExecutor_js_1.DecafHandlerExecutor],
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
exports.DecafWebhookModule = DecafWebhookModule;
|
|
135
|
+
exports.DecafWebhookModule = DecafWebhookModule = DecafWebhookModule_1 = __decorate([
|
|
136
|
+
(0, common_1.Module)({})
|
|
137
|
+
], DecafWebhookModule);
|
|
138
|
+
exports.DecafWebhooksModule = DecafWebhookModule;
|
|
139
|
+
async function runWebhooksMigrations() { }
|
|
140
|
+
//# sourceMappingURL=DecafWebhookModule.js.map
|
|
141
|
+
//# sourceMappingURL=DecafWebhookModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DecafWebhookModule.js","sourceRoot":"","sources":["DecafWebhookModule.js"],"names":[],"mappings":";;;AAkIA,sDAAiD;AAlIjD,IAAI,UAAU,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI;IACjF,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAA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,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE;iBAChE;gBACD;oBACI,OAAO,EAAE,sBAAe;oBACxB,QAAQ,EAAE,kEAA8B;iBAC3C;aACJ;YACD,OAAO,EAAE,CAAC,8BAAmB,EAAE,8CAAoB,CAAC;SACvD,CAAC;IACN,CAAC;CACJ,CAAC;AAIO,gDAAkB;AAH3B,6BAAA,kBAAkB,GAAG,oBAAoB,GAAG,UAAU,CAAC;IACnD,IAAA,eAAM,EAAC,EAAE,CAAC;CACb,EAAE,kBAAkB,CAAC,CAAC;AAEV,QAAA,mBAAmB,GAAG,kBAAkB,CAAC;AAC/C,KAAK,UAAU,qBAAqB,KAAK,CAAC;AACjD,8CAA8C"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebhookEventActionsController = exports.WebhookSubscriptionActionsController = void 0;
|
|
4
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
5
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
8
|
+
else
|
|
9
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
10
|
+
if (d = decorators[i])
|
|
11
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
12
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
|
+
};
|
|
14
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
15
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
16
|
+
return Reflect.metadata(k, v);
|
|
17
|
+
};
|
|
18
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
19
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
20
|
+
};
|
|
21
|
+
var WebhookSubscriptionActionsController_1, WebhookEventActionsController_1;
|
|
22
|
+
const common_1 = require("@nestjs/common");
|
|
23
|
+
const core_1 = require("@decaf-ts/core");
|
|
24
|
+
const controllers_js_1 = require("./../controllers.cjs");
|
|
25
|
+
const index_js_1 = require("./../request/index.cjs");
|
|
26
|
+
const server_1 = require("@decaf-ts/for-http/server");
|
|
27
|
+
let WebhookSubscriptionActionsController = WebhookSubscriptionActionsController_1 = class WebhookSubscriptionActionsController extends controllers_js_1.DecafController {
|
|
28
|
+
constructor(clientContext) {
|
|
29
|
+
super(clientContext, WebhookSubscriptionActionsController_1.name);
|
|
30
|
+
}
|
|
31
|
+
async deactivate(id) {
|
|
32
|
+
const { ctx } = (await this.logCtx([], "deactivate", true)).for(this.deactivate);
|
|
33
|
+
const repo = core_1.Repository.forModel(server_1.WebhookSubscription);
|
|
34
|
+
const current = await repo.read(id, ctx);
|
|
35
|
+
current.active = false;
|
|
36
|
+
return repo.update(current, ctx);
|
|
37
|
+
}
|
|
38
|
+
async reactivate(id) {
|
|
39
|
+
const { ctx } = (await this.logCtx([], "reactivate", true)).for(this.reactivate);
|
|
40
|
+
const repo = core_1.Repository.forModel(server_1.WebhookSubscription);
|
|
41
|
+
const current = await repo.read(id, ctx);
|
|
42
|
+
current.active = true;
|
|
43
|
+
return repo.update(current, ctx);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.WebhookSubscriptionActionsController = WebhookSubscriptionActionsController;
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, common_1.Post)(":id/deactivate"),
|
|
49
|
+
__param(0, (0, common_1.Param)("id")),
|
|
50
|
+
__metadata("design:type", Function),
|
|
51
|
+
__metadata("design:paramtypes", [String]),
|
|
52
|
+
__metadata("design:returntype", Promise)
|
|
53
|
+
], WebhookSubscriptionActionsController.prototype, "deactivate", null);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, common_1.Post)(":id/reactivate"),
|
|
56
|
+
__param(0, (0, common_1.Param)("id")),
|
|
57
|
+
__metadata("design:type", Function),
|
|
58
|
+
__metadata("design:paramtypes", [String]),
|
|
59
|
+
__metadata("design:returntype", Promise)
|
|
60
|
+
], WebhookSubscriptionActionsController.prototype, "reactivate", null);
|
|
61
|
+
exports.WebhookSubscriptionActionsController = WebhookSubscriptionActionsController = WebhookSubscriptionActionsController_1 = __decorate([
|
|
62
|
+
(0, common_1.Controller)("webhook-subscriptions"),
|
|
63
|
+
__metadata("design:paramtypes", [index_js_1.DecafRequestContext])
|
|
64
|
+
], WebhookSubscriptionActionsController);
|
|
65
|
+
let WebhookEventActionsController = WebhookEventActionsController_1 = class WebhookEventActionsController extends controllers_js_1.DecafController {
|
|
66
|
+
constructor(clientContext) {
|
|
67
|
+
super(clientContext, WebhookEventActionsController_1.name);
|
|
68
|
+
}
|
|
69
|
+
async replay(id) {
|
|
70
|
+
const { ctx } = (await this.logCtx([], "replay", true)).for(this.replay);
|
|
71
|
+
const eventRepo = core_1.Repository.forModel(server_1.WebhookEventRecord);
|
|
72
|
+
const deliveryRepo = core_1.Repository.forModel(server_1.WebhookDelivery);
|
|
73
|
+
try {
|
|
74
|
+
let event;
|
|
75
|
+
try {
|
|
76
|
+
event = await eventRepo.read(id, ctx);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
const events = await eventRepo
|
|
80
|
+
.select()
|
|
81
|
+
.where(eventRepo.attr("id").eq(id))
|
|
82
|
+
.limit(1)
|
|
83
|
+
.execute(ctx);
|
|
84
|
+
if (!events.length)
|
|
85
|
+
throw error;
|
|
86
|
+
event = events[0];
|
|
87
|
+
}
|
|
88
|
+
let deliveries = [];
|
|
89
|
+
try {
|
|
90
|
+
deliveries = await (0, server_1.collectPagedResults)(() => deliveryRepo
|
|
91
|
+
.select()
|
|
92
|
+
.where(deliveryRepo.attr("eventId").eq(event.id))
|
|
93
|
+
.orderBy("createdAt", core_1.OrderDirection.ASC)
|
|
94
|
+
.thenBy("id", core_1.OrderDirection.ASC)
|
|
95
|
+
.paginate(250, ctx), 250, ctx);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
try {
|
|
99
|
+
deliveries = await deliveryRepo
|
|
100
|
+
.select()
|
|
101
|
+
.where(deliveryRepo.attr("eventId").eq(event.id))
|
|
102
|
+
.execute(ctx);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
deliveries = [];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const now = new Date();
|
|
109
|
+
for (const delivery of deliveries) {
|
|
110
|
+
delivery.status = server_1.WebhookStatus.PENDING;
|
|
111
|
+
delivery.attempts = 0;
|
|
112
|
+
delivery.nextAttemptAt = now;
|
|
113
|
+
delivery.lastAttemptAt = null;
|
|
114
|
+
delivery.errorMessage = undefined;
|
|
115
|
+
delivery.responseStatus = undefined;
|
|
116
|
+
delivery.responseBody = undefined;
|
|
117
|
+
}
|
|
118
|
+
event.status = server_1.WebhookStatus.PENDING;
|
|
119
|
+
event.deliveriesSucceeded = 0;
|
|
120
|
+
event.deliveriesFailed = 0;
|
|
121
|
+
event.nextAttemptAt = now;
|
|
122
|
+
event.updatedAt = now;
|
|
123
|
+
if (deliveries.length) {
|
|
124
|
+
try {
|
|
125
|
+
await deliveryRepo.updateAll(deliveries, ctx.override({ applyUpdateValidation: false }));
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
// Replay still resets the event state even if bulk delivery updates are not queryable here.
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return eventRepo.update(event, ctx);
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
exports.WebhookEventActionsController = WebhookEventActionsController;
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, common_1.Post)(":id/replay"),
|
|
141
|
+
__param(0, (0, common_1.Param)("id")),
|
|
142
|
+
__metadata("design:type", Function),
|
|
143
|
+
__metadata("design:paramtypes", [String]),
|
|
144
|
+
__metadata("design:returntype", Promise)
|
|
145
|
+
], WebhookEventActionsController.prototype, "replay", null);
|
|
146
|
+
exports.WebhookEventActionsController = WebhookEventActionsController = WebhookEventActionsController_1 = __decorate([
|
|
147
|
+
(0, common_1.Controller)("webhook-events"),
|
|
148
|
+
__metadata("design:paramtypes", [index_js_1.DecafRequestContext])
|
|
149
|
+
], WebhookEventActionsController);
|
|
150
|
+
//# sourceMappingURL=controllers.js.map
|
|
151
|
+
//# sourceMappingURL=controllers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controllers.js","sourceRoot":"","sources":["controllers.js"],"names":[],"mappings":";;;AAAA,IAAI,UAAU,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI;IACjF,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7H,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;QAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;;QAC1H,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YAAE,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAA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CAC3C,EAAE,6BAA6B,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC5D,wCAAA,6BAA6B,GAAG,+BAA+B,GAAG,UAAU,CAAC;IACzE,IAAA,mBAAU,EAAC,gBAAgB,CAAC;IAC5B,UAAU,CAAC,mBAAmB,EAAE,CAAC,8BAAmB,CAAC,CAAC;CACzD,EAAE,6BAA6B,CAAC,CAAC;AAElC,uCAAuC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.verifyWebhookSignature = exports.signWebhookPayload = exports.computeNextAttempt = exports.WebhookSubscriptionService = exports.WebhookSubscription = exports.WebhookStatus = exports.WebhookSignatureMiddleware = exports.WebhookPublisherService = exports.WebhookEventRecord = exports.WebhookDeliveryService = exports.WebhookDelivery = void 0;
|
|
18
|
+
__exportStar(require("./DecafWebhookModule.cjs"), exports);
|
|
19
|
+
__exportStar(require("./controllers.cjs"), exports);
|
|
20
|
+
__exportStar(require("./types.cjs"), exports);
|
|
21
|
+
var server_1 = require("@decaf-ts/for-http/server");
|
|
22
|
+
Object.defineProperty(exports, "WebhookDelivery", { enumerable: true, get: function () { return server_1.WebhookDelivery; } });
|
|
23
|
+
Object.defineProperty(exports, "WebhookDeliveryService", { enumerable: true, get: function () { return server_1.WebhookDeliveryService; } });
|
|
24
|
+
Object.defineProperty(exports, "WebhookEventRecord", { enumerable: true, get: function () { return server_1.WebhookEventRecord; } });
|
|
25
|
+
Object.defineProperty(exports, "WebhookPublisherService", { enumerable: true, get: function () { return server_1.WebhookPublisherService; } });
|
|
26
|
+
Object.defineProperty(exports, "WebhookSignatureMiddleware", { enumerable: true, get: function () { return server_1.WebhookSignatureMiddleware; } });
|
|
27
|
+
Object.defineProperty(exports, "WebhookStatus", { enumerable: true, get: function () { return server_1.WebhookStatus; } });
|
|
28
|
+
Object.defineProperty(exports, "WebhookSubscription", { enumerable: true, get: function () { return server_1.WebhookSubscription; } });
|
|
29
|
+
Object.defineProperty(exports, "WebhookSubscriptionService", { enumerable: true, get: function () { return server_1.WebhookSubscriptionService; } });
|
|
30
|
+
Object.defineProperty(exports, "computeNextAttempt", { enumerable: true, get: function () { return server_1.computeNextAttempt; } });
|
|
31
|
+
Object.defineProperty(exports, "signWebhookPayload", { enumerable: true, get: function () { return server_1.signWebhookPayload; } });
|
|
32
|
+
Object.defineProperty(exports, "verifyWebhookSignature", { enumerable: true, get: function () { return server_1.verifyWebhookSignature; } });
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,mDAAiC;AACjC,6CAA2B;AAC3B,oDAA8R;AAArR,yGAAA,eAAe,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AAAE,4GAAA,kBAAkB,OAAA;AAAE,iHAAA,uBAAuB,OAAA;AAAE,oHAAA,0BAA0B,OAAA;AAAE,uGAAA,aAAa,OAAA;AAAE,6GAAA,mBAAmB,OAAA;AAAE,oHAAA,0BAA0B,OAAA;AAAE,4GAAA,kBAAkB,OAAA;AAAE,4GAAA,kBAAkB,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACzP,iCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;AACA,iCAAiC"}
|
package/lib/esm/index.js
CHANGED
|
@@ -35,27 +35,28 @@ export * from "./migrations/index.js";
|
|
|
35
35
|
export * from "./types.js";
|
|
36
36
|
export * from "./utils.js";
|
|
37
37
|
export * from "./events-module/index.js";
|
|
38
|
+
export * from "./webhooks/index.js";
|
|
38
39
|
/**
|
|
39
40
|
* Represents the current version of the ts-workspace module.
|
|
40
41
|
* The actual version number is replaced during the build process.
|
|
41
42
|
* @constant
|
|
42
43
|
* @type {string}
|
|
43
44
|
*/
|
|
44
|
-
export const VERSION = "0.10.
|
|
45
|
+
export const VERSION = "0.10.2";
|
|
45
46
|
/**
|
|
46
47
|
* @description Represents the current commit hash of the module build.
|
|
47
48
|
* @summary Stores the current git commit hash for the package. The build replaces
|
|
48
49
|
* the placeholder with the actual commit hash at publish time.
|
|
49
50
|
* @const COMMIT
|
|
50
51
|
*/
|
|
51
|
-
export const COMMIT = "
|
|
52
|
+
export const COMMIT = "cee7a8b";
|
|
52
53
|
/**
|
|
53
54
|
* @description Represents the full version string of the module.
|
|
54
55
|
* @summary Stores the semver version and commit hash for the package.
|
|
55
56
|
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
56
57
|
* @const FULL_VERSION
|
|
57
58
|
*/
|
|
58
|
-
export const FULL_VERSION = "0.10.
|
|
59
|
+
export const FULL_VERSION = "0.10.2-cee7a8b";
|
|
59
60
|
export const PACKAGE_NAME = "@decaf-ts/for-nest";
|
|
60
61
|
Metadata.allowReregistration(true);
|
|
61
62
|
Metadata.registerLibrary(PACKAGE_NAME, VERSION);
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,yBAAsB;AAEtB,gCAA6B,CAAC,oBAAoB;AAClD,uCAA8B;AAC9B,mCAA0B;AAC1B,wCAA+B;AAC/B,qCAA4B;AAC5B,mCAA0B;AAC1B,+BAA4B;AAC5B,iCAA8B;AAC9B,4BAAyB;AACzB,iCAA8B;AAC9B,sCAA6B;AAC7B,2BAAwB;AACxB,2BAAwB;AACxB,yCAAgC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,yBAAsB;AAEtB,gCAA6B,CAAC,oBAAoB;AAClD,uCAA8B;AAC9B,mCAA0B;AAC1B,wCAA+B;AAC/B,qCAA4B;AAC5B,mCAA0B;AAC1B,+BAA4B;AAC5B,iCAA8B;AAC9B,4BAAyB;AACzB,iCAA8B;AAC9B,sCAA6B;AAC7B,2BAAwB;AACxB,2BAAwB;AACxB,yCAAgC;AAChC,oCAA2B;AAE3B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AAErC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;AAE1C,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;AACnC,QAAQ,CAAC,eAAe,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAChD,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var DecafWebhookModule_1;
|
|
8
|
+
import { Module } from "@nestjs/common";
|
|
9
|
+
import { RouterModule } from "@nestjs/core";
|
|
10
|
+
import { Adapter, PersistenceService, } from "@decaf-ts/core";
|
|
11
|
+
import { InternalError } from "@decaf-ts/db-decorators";
|
|
12
|
+
import { uses } from "@decaf-ts/decoration";
|
|
13
|
+
import { Logging } from "@decaf-ts/logging";
|
|
14
|
+
import { DecafRequestContext } from "./../request/index.js";
|
|
15
|
+
import { DecafHandlerExecutor } from "./../request/DecafHandlerExecutor.js";
|
|
16
|
+
import { DecafRequestHandlerInterceptor } from "./../interceptors/DecafRequestHandlerInterceptor.js";
|
|
17
|
+
import { DECAF_HANDLERS } from "./../constants.js";
|
|
18
|
+
import { APP_INTERCEPTOR } from "@nestjs/core";
|
|
19
|
+
import { FromModelController } from "./../decaf-model/index.js";
|
|
20
|
+
import { requestToContextTransformer } from "./../interceptors/context.js";
|
|
21
|
+
import { WebhookDelivery, WebhookEventRecord, WebhookSubscription, } from "@decaf-ts/for-http/server";
|
|
22
|
+
import { WebhookEventActionsController, WebhookSubscriptionActionsController, } from "./controllers.js";
|
|
23
|
+
let DecafWebhookModule = class DecafWebhookModule {
|
|
24
|
+
static { DecafWebhookModule_1 = this; }
|
|
25
|
+
static { this._logger = Logging.for(DecafWebhookModule_1); }
|
|
26
|
+
static get log() {
|
|
27
|
+
return this._logger;
|
|
28
|
+
}
|
|
29
|
+
static async bootPersistence(options) {
|
|
30
|
+
const log = this.log.for(this.bootPersistence);
|
|
31
|
+
if (!this._persistence) {
|
|
32
|
+
const trimmed = options.conf.map(([contr, cfg, ...args]) => {
|
|
33
|
+
const possible = args.pop();
|
|
34
|
+
if (!possible)
|
|
35
|
+
return [contr, cfg];
|
|
36
|
+
return [contr, cfg, ...args];
|
|
37
|
+
});
|
|
38
|
+
this._persistence = new PersistenceService();
|
|
39
|
+
await this._persistence.boot(trimmed);
|
|
40
|
+
const clients = this._persistence.client;
|
|
41
|
+
for (let i = 0; i < clients.length; i++) {
|
|
42
|
+
const cache = Adapter._cache || (Adapter._cache = {});
|
|
43
|
+
const webhookKeys = [
|
|
44
|
+
clients[i].flavour,
|
|
45
|
+
clients[i].alias,
|
|
46
|
+
"webhook_deliveries",
|
|
47
|
+
"webhook_events",
|
|
48
|
+
"webhook_subscriptions",
|
|
49
|
+
].filter((value) => !!value);
|
|
50
|
+
for (const key of webhookKeys) {
|
|
51
|
+
cache[key] = clients[i];
|
|
52
|
+
}
|
|
53
|
+
const c = options.conf[i];
|
|
54
|
+
const possibleTransf = c.slice(2, c.length);
|
|
55
|
+
let transformer = possibleTransf.pop();
|
|
56
|
+
if (!transformer ||
|
|
57
|
+
!transformer.from) {
|
|
58
|
+
const contr = Adapter.transformerFor(clients[i].flavour);
|
|
59
|
+
if (!contr)
|
|
60
|
+
throw new InternalError(`No transformer found for flavour ${clients[i].flavour}.`);
|
|
61
|
+
try {
|
|
62
|
+
transformer = contr.from
|
|
63
|
+
? contr
|
|
64
|
+
: new contr();
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
throw new InternalError(`Failed to boot transformer for ${clients[i].flavour}: ${e}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
requestToContextTransformer(clients[i].flavour)(transformer);
|
|
71
|
+
uses(clients[i].flavour)(WebhookSubscription);
|
|
72
|
+
uses(clients[i].flavour)(WebhookEventRecord);
|
|
73
|
+
uses(clients[i].flavour)(WebhookDelivery);
|
|
74
|
+
}
|
|
75
|
+
log.info("persistence layer created successfully!");
|
|
76
|
+
if (options.initialization) {
|
|
77
|
+
try {
|
|
78
|
+
await options.initialization();
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
throw new InternalError(`Failed to initialize webhook module: ${e}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return this._persistence.client;
|
|
86
|
+
}
|
|
87
|
+
static async forRoot(options) {
|
|
88
|
+
return this.forRootAsync(options);
|
|
89
|
+
}
|
|
90
|
+
static async forRootAsync(options) {
|
|
91
|
+
const adapters = await this.bootPersistence(options);
|
|
92
|
+
const controllers = [
|
|
93
|
+
FromModelController.create(WebhookSubscription),
|
|
94
|
+
FromModelController.create(WebhookEventRecord),
|
|
95
|
+
FromModelController.create(WebhookDelivery),
|
|
96
|
+
WebhookSubscriptionActionsController,
|
|
97
|
+
WebhookEventActionsController,
|
|
98
|
+
];
|
|
99
|
+
return {
|
|
100
|
+
module: DecafWebhookModule_1,
|
|
101
|
+
controllers,
|
|
102
|
+
imports: [
|
|
103
|
+
RouterModule.register([
|
|
104
|
+
{
|
|
105
|
+
path: (options.webhookApiPath || "webhooks").replace(/^\//, ""),
|
|
106
|
+
module: DecafWebhookModule_1,
|
|
107
|
+
},
|
|
108
|
+
]),
|
|
109
|
+
],
|
|
110
|
+
providers: [
|
|
111
|
+
DecafRequestContext,
|
|
112
|
+
DecafHandlerExecutor,
|
|
113
|
+
{
|
|
114
|
+
provide: DECAF_HANDLERS,
|
|
115
|
+
useFactory: () => options.handlers?.map((H) => new H()) ?? [],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
provide: APP_INTERCEPTOR,
|
|
119
|
+
useClass: DecafRequestHandlerInterceptor,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
exports: [DecafRequestContext, DecafHandlerExecutor],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
DecafWebhookModule = DecafWebhookModule_1 = __decorate([
|
|
127
|
+
Module({})
|
|
128
|
+
], DecafWebhookModule);
|
|
129
|
+
export { DecafWebhookModule };
|
|
130
|
+
export const DecafWebhooksModule = DecafWebhookModule;
|
|
131
|
+
export async function runWebhooksMigrations() { }
|
|
132
|
+
//# sourceMappingURL=DecafWebhookModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DecafWebhookModule.js","sourceRoot":"","sources":["../../../src/webhooks/DecafWebhookModule.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,OAAO,EACP,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAe,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,8BAAmB;AACjD,OAAO,EAAE,oBAAoB,EAAE,6CAAwC;AACvE,OAAO,EAAE,8BAA8B,EAAE,4DAAuD;AAChG,OAAO,EAAE,cAAc,EAAE,0BAAqB;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAAE,kCAAuB;AACrD,OAAO,EAAE,2BAA2B,EAAE,qCAAgC;AACtE,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,6BAA6B,EAC7B,oCAAoC,GACrC,yBAAsB;AAGhB,IA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