@nathapp/nestjs-outbox-recorder 1.0.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,6 @@
1
+ export * from '@nathapp/nestjs-outbox';
2
+ import { OUTBOX_RECORDER as ACCOUNT_OUTBOX_RECORDER } from '@nathapp/nestjs-account';
3
+ import { OUTBOX_RECORDER as IAM_OUTBOX_RECORDER } from '@nathapp/nestjs-iam';
4
+ export { ACCOUNT_OUTBOX_RECORDER, IAM_OUTBOX_RECORDER };
5
+ export { OutboxRecorderBridge } from './outbox-recorder.bridge';
6
+ export { OutboxRecorderModule } from './outbox-recorder.module';
package/dist/index.js ADDED
@@ -0,0 +1,27 @@
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.OutboxRecorderModule = exports.OutboxRecorderBridge = exports.IAM_OUTBOX_RECORDER = exports.ACCOUNT_OUTBOX_RECORDER = void 0;
18
+ __exportStar(require("@nathapp/nestjs-outbox"), exports);
19
+ const nestjs_account_1 = require("@nathapp/nestjs-account");
20
+ Object.defineProperty(exports, "ACCOUNT_OUTBOX_RECORDER", { enumerable: true, get: function () { return nestjs_account_1.OUTBOX_RECORDER; } });
21
+ const nestjs_iam_1 = require("@nathapp/nestjs-iam");
22
+ Object.defineProperty(exports, "IAM_OUTBOX_RECORDER", { enumerable: true, get: function () { return nestjs_iam_1.OUTBOX_RECORDER; } });
23
+ var outbox_recorder_bridge_1 = require("./outbox-recorder.bridge");
24
+ Object.defineProperty(exports, "OutboxRecorderBridge", { enumerable: true, get: function () { return outbox_recorder_bridge_1.OutboxRecorderBridge; } });
25
+ var outbox_recorder_module_1 = require("./outbox-recorder.module");
26
+ Object.defineProperty(exports, "OutboxRecorderModule", { enumerable: true, get: function () { return outbox_recorder_module_1.OutboxRecorderModule; } });
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAuC;AAEvC,4DAAqF;AAG5E,wGAHmB,gCAAuB,OAGnB;AAFhC,oDAA6E;AAE3C,oGAFN,4BAAmB,OAEM;AAErD,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA"}
@@ -0,0 +1,12 @@
1
+ import { OutboxService, OutboxRecord } from '@nathapp/nestjs-outbox';
2
+ import type { IOutboxRecorder } from '@nathapp/nestjs-account';
3
+ import type { IOutboxRecorder as IIamOutboxRecorder } from '@nathapp/nestjs-iam';
4
+ export declare class OutboxRecorderBridge implements IOutboxRecorder, IIamOutboxRecorder {
5
+ private readonly outbox;
6
+ constructor(outbox: OutboxService);
7
+ record(event: {
8
+ type: string;
9
+ payload: unknown;
10
+ metadata?: Record<string, unknown>;
11
+ }): Promise<OutboxRecord>;
12
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OutboxRecorderBridge = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const nestjs_outbox_1 = require("@nathapp/nestjs-outbox");
15
+ let OutboxRecorderBridge = class OutboxRecorderBridge {
16
+ constructor(outbox) {
17
+ this.outbox = outbox;
18
+ }
19
+ record(event) {
20
+ return this.outbox.record(event);
21
+ }
22
+ };
23
+ exports.OutboxRecorderBridge = OutboxRecorderBridge;
24
+ exports.OutboxRecorderBridge = OutboxRecorderBridge = __decorate([
25
+ (0, common_1.Injectable)(),
26
+ __metadata("design:paramtypes", [nestjs_outbox_1.OutboxService])
27
+ ], OutboxRecorderBridge);
28
+ //# sourceMappingURL=outbox-recorder.bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outbox-recorder.bridge.js","sourceRoot":"","sources":["../lib/outbox-recorder.bridge.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,0DAAqE;AAK9D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAA6B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAEtD,MAAM,CAAC,KAA6E;QAClF,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF,CAAA;AANY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAE0B,6BAAa;GADvC,oBAAoB,CAMhC"}
@@ -0,0 +1,6 @@
1
+ import { DynamicModule } from '@nestjs/common';
2
+ import { OutboxModuleOptions, OutboxRegisterAsyncOptions } from '@nathapp/nestjs-outbox';
3
+ export declare class OutboxRecorderModule {
4
+ static register(options?: OutboxModuleOptions): DynamicModule;
5
+ static registerAsync(options: OutboxRegisterAsyncOptions): DynamicModule;
6
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var OutboxRecorderModule_1;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.OutboxRecorderModule = void 0;
11
+ const common_1 = require("@nestjs/common");
12
+ const nestjs_outbox_1 = require("@nathapp/nestjs-outbox");
13
+ const nestjs_account_1 = require("@nathapp/nestjs-account");
14
+ const nestjs_iam_1 = require("@nathapp/nestjs-iam");
15
+ const outbox_recorder_bridge_1 = require("./outbox-recorder.bridge");
16
+ const bindings = () => [
17
+ outbox_recorder_bridge_1.OutboxRecorderBridge,
18
+ { provide: nestjs_account_1.OUTBOX_RECORDER, useExisting: outbox_recorder_bridge_1.OutboxRecorderBridge },
19
+ { provide: nestjs_iam_1.OUTBOX_RECORDER, useExisting: outbox_recorder_bridge_1.OutboxRecorderBridge },
20
+ ];
21
+ let OutboxRecorderModule = OutboxRecorderModule_1 = class OutboxRecorderModule {
22
+ static register(options) {
23
+ return {
24
+ module: OutboxRecorderModule_1,
25
+ global: true,
26
+ imports: [nestjs_outbox_1.OutboxModule.register(options)],
27
+ providers: bindings(),
28
+ exports: [nestjs_account_1.OUTBOX_RECORDER, nestjs_iam_1.OUTBOX_RECORDER, outbox_recorder_bridge_1.OutboxRecorderBridge],
29
+ };
30
+ }
31
+ static registerAsync(options) {
32
+ return {
33
+ module: OutboxRecorderModule_1,
34
+ global: true,
35
+ imports: [nestjs_outbox_1.OutboxModule.registerAsync(options)],
36
+ providers: bindings(),
37
+ exports: [nestjs_account_1.OUTBOX_RECORDER, nestjs_iam_1.OUTBOX_RECORDER, outbox_recorder_bridge_1.OutboxRecorderBridge],
38
+ };
39
+ }
40
+ };
41
+ exports.OutboxRecorderModule = OutboxRecorderModule;
42
+ exports.OutboxRecorderModule = OutboxRecorderModule = OutboxRecorderModule_1 = __decorate([
43
+ (0, common_1.Module)({})
44
+ ], OutboxRecorderModule);
45
+ //# sourceMappingURL=outbox-recorder.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outbox-recorder.module.js","sourceRoot":"","sources":["../lib/outbox-recorder.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAiE;AACjE,0DAIgC;AAChC,4DAAqF;AACrF,oDAA6E;AAC7E,qEAAgE;AAEhE,MAAM,QAAQ,GAAG,GAAe,EAAE,CAAC;IACjC,6CAAoB;IACpB,EAAE,OAAO,EAAE,gCAAuB,EAAE,WAAW,EAAE,6CAAoB,EAAE;IACvE,EAAE,OAAO,EAAE,4BAAmB,EAAE,WAAW,EAAE,6CAAoB,EAAE;CACpE,CAAC;AAGK,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAC/B,MAAM,CAAC,QAAQ,CAAC,OAA6B;QAC3C,OAAO;YACL,MAAM,EAAE,sBAAoB;YAC5B,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,CAAC,4BAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACzC,SAAS,EAAE,QAAQ,EAAE;YACrB,OAAO,EAAE,CAAC,gCAAuB,EAAE,4BAAmB,EAAE,6CAAoB,CAAC;SAC9E,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,OAAmC;QACtD,OAAO;YACL,MAAM,EAAE,sBAAoB;YAC5B,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,CAAC,4BAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YAC9C,SAAS,EAAE,QAAQ,EAAE;YACrB,OAAO,EAAE,CAAC,gCAAuB,EAAE,4BAAmB,EAAE,6CAAoB,CAAC;SAC9E,CAAC;IACJ,CAAC;CACF,CAAA;AApBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,oBAAoB,CAoBhC"}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@nathapp/nestjs-outbox-recorder",
3
+ "version": "1.0.0",
4
+ "description": "Durable-delivery glue that binds the @nathapp/nestjs-account and @nathapp/nestjs-iam OUTBOX_RECORDER seam to the core @nathapp/nestjs-outbox relay",
5
+ "scripts": {
6
+ "build": "rimraf dist && tsc -p tsconfig.json",
7
+ "clean": "rimraf dist/ .turbo/",
8
+ "lint": "eslint -c .eslintrc.js --ext .ts .",
9
+ "lint:fix": "eslint -c .eslintrc.js --ext .ts . --fix",
10
+ "test": "jest --config ./test/jest-test.json --no-colors --silent --forceExit",
11
+ "test:json": "jest --config ./test/jest-test.json --json --no-colors --silent --forceExit",
12
+ "test:verbose": "jest --config ./test/jest-test.json --forceExit",
13
+ "test:cov": "jest --config ./test/jest-test.json --coverage --forceExit",
14
+ "type-check": "tsc --noEmit -p tsconfig.json"
15
+ },
16
+ "author": "",
17
+ "license": "ISC",
18
+ "engines": {
19
+ "node": "^20.19.0 || >=22.12.0"
20
+ },
21
+ "types": "dist/index.d.ts",
22
+ "main": "dist/index.js",
23
+ "directories": {
24
+ "lib": "lib"
25
+ },
26
+ "dependencies": {
27
+ "@nathapp/nestjs-account": "1.0.0",
28
+ "@nathapp/nestjs-iam": "1.0.0",
29
+ "@nathapp/nestjs-outbox": "^3.3.0 || ^4.0.2"
30
+ },
31
+ "devDependencies": {
32
+ "@nathapp/nestjs-common": "^4.0.2",
33
+ "eslint": "^8.57.0",
34
+ "typescript": "^5"
35
+ },
36
+ "peerDependencies": {
37
+ "@nestjs/common": "^11.0.0 || ^12.1.0",
38
+ "@nestjs/core": "^11.0.0 || ^12.1.0"
39
+ }
40
+ }