@accon/connect 0.0.1
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/LICENSE +25 -0
- package/README.md +60 -0
- package/coverage/clover.xml +232 -0
- package/coverage/coverage-final.json +21 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +236 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +387 -0
- package/dist/core/connect.module.d.ts +2 -0
- package/dist/core/connect.module.js +25 -0
- package/dist/core/connect.module.js.map +1 -0
- package/dist/core/connect.service.d.ts +16 -0
- package/dist/core/connect.service.js +60 -0
- package/dist/core/connect.service.js.map +1 -0
- package/dist/core/decorators/index.d.ts +1 -0
- package/dist/core/decorators/index.js +18 -0
- package/dist/core/decorators/index.js.map +1 -0
- package/dist/core/decorators/registry-integration.decorator.d.ts +3 -0
- package/dist/core/decorators/registry-integration.decorator.js +12 -0
- package/dist/core/decorators/registry-integration.decorator.js.map +1 -0
- package/dist/core/events/events.module.d.ts +2 -0
- package/dist/core/events/events.module.js +23 -0
- package/dist/core/events/events.module.js.map +1 -0
- package/dist/core/events/events.service.d.ts +9 -0
- package/dist/core/events/events.service.js +44 -0
- package/dist/core/events/events.service.js.map +1 -0
- package/dist/core/events/index.d.ts +2 -0
- package/dist/core/events/index.js +19 -0
- package/dist/core/events/index.js.map +1 -0
- package/dist/core/exceptions/index.d.ts +1 -0
- package/dist/core/exceptions/index.js +18 -0
- package/dist/core/exceptions/index.js.map +1 -0
- package/dist/core/exceptions/invalid-order.exception.d.ts +5 -0
- package/dist/core/exceptions/invalid-order.exception.js +12 -0
- package/dist/core/exceptions/invalid-order.exception.js.map +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +24 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/integration-loader.d.ts +1 -0
- package/dist/core/integration-loader.js +14 -0
- package/dist/core/integration-loader.js.map +1 -0
- package/dist/core/integration-registry.service.d.ts +9 -0
- package/dist/core/integration-registry.service.js +31 -0
- package/dist/core/integration-registry.service.js.map +1 -0
- package/dist/core/interfaces/index.d.ts +2 -0
- package/dist/core/interfaces/index.js +19 -0
- package/dist/core/interfaces/index.js.map +1 -0
- package/dist/core/interfaces/integration-meta.interface.d.ts +13 -0
- package/dist/core/interfaces/integration-meta.interface.js +3 -0
- package/dist/core/interfaces/integration-meta.interface.js.map +1 -0
- package/dist/core/interfaces/order-output-integration.interface.d.ts +4 -0
- package/dist/core/interfaces/order-output-integration.interface.js +3 -0
- package/dist/core/interfaces/order-output-integration.interface.js.map +1 -0
- package/dist/core/types/index.d.ts +4 -0
- package/dist/core/types/index.js +21 -0
- package/dist/core/types/index.js.map +1 -0
- package/dist/core/types/integration-category.type.d.ts +1 -0
- package/dist/core/types/integration-category.type.js +3 -0
- package/dist/core/types/integration-category.type.js.map +1 -0
- package/dist/core/types/integration-event-dispatcher.type.d.ts +2 -0
- package/dist/core/types/integration-event-dispatcher.type.js +3 -0
- package/dist/core/types/integration-event-dispatcher.type.js.map +1 -0
- package/dist/core/types/integration-event.type.d.ts +13 -0
- package/dist/core/types/integration-event.type.js +13 -0
- package/dist/core/types/integration-event.type.js.map +1 -0
- package/dist/core/types/integration-type.type.d.ts +1 -0
- package/dist/core/types/integration-type.type.js +3 -0
- package/dist/core/types/integration-type.type.js.map +1 -0
- package/dist/core/types/order.type.d.ts +155 -0
- package/dist/core/types/order.type.js +3 -0
- package/dist/core/types/order.type.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/logistics/foody/dto/create-foody-order-response.dto.d.ts +4 -0
- package/dist/logistics/foody/dto/create-foody-order-response.dto.js +9 -0
- package/dist/logistics/foody/dto/create-foody-order-response.dto.js.map +1 -0
- package/dist/logistics/foody/dto/create-foody-order.dto.d.ts +31 -0
- package/dist/logistics/foody/dto/create-foody-order.dto.js +19 -0
- package/dist/logistics/foody/dto/create-foody-order.dto.js.map +1 -0
- package/dist/logistics/foody/foody.config.d.ts +15 -0
- package/dist/logistics/foody/foody.config.js +17 -0
- package/dist/logistics/foody/foody.config.js.map +1 -0
- package/dist/logistics/foody/foody.order-output.d.ts +15 -0
- package/dist/logistics/foody/foody.order-output.js +148 -0
- package/dist/logistics/foody/foody.order-output.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/eslint.config.mjs +35 -0
- package/index.js +6 -0
- package/nest-cli.json +8 -0
- package/package.json +76 -0
- package/test/jest-e2e.json +9 -0
- package/tsconfig.build.json +4 -0
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
__exportStar(require("./registry-integration.decorator"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/core/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RegistryIntegration = RegistryIntegration;
|
|
4
|
+
require("reflect-metadata");
|
|
5
|
+
const integration_registry_service_1 = require("../integration-registry.service");
|
|
6
|
+
function RegistryIntegration(meta) {
|
|
7
|
+
return (target) => {
|
|
8
|
+
Reflect.defineMetadata('integration:meta', meta, target);
|
|
9
|
+
integration_registry_service_1.IntegrationRegistryService.register(meta, target);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=registry-integration.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-integration.decorator.js","sourceRoot":"","sources":["../../../lib/core/decorators/registry-integration.decorator.ts"],"names":[],"mappings":";;AAIA,kDAKC;AATD,4BAA0B;AAC1B,kFAA6E;AAG7E,SAAgB,mBAAmB,CAAC,IAAqB;IACvD,OAAO,CAAC,MAAgB,EAAE,EAAE;QAC1B,OAAO,CAAC,cAAc,CAAC,kBAAkB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACzD,yDAA0B,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.EventsModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
12
|
+
const events_service_1 = require("./events.service");
|
|
13
|
+
let EventsModule = class EventsModule {
|
|
14
|
+
};
|
|
15
|
+
exports.EventsModule = EventsModule;
|
|
16
|
+
exports.EventsModule = EventsModule = __decorate([
|
|
17
|
+
(0, common_1.Module)({
|
|
18
|
+
imports: [event_emitter_1.EventEmitterModule],
|
|
19
|
+
providers: [events_service_1.EventsService],
|
|
20
|
+
exports: [events_service_1.EventsService],
|
|
21
|
+
})
|
|
22
|
+
], EventsModule);
|
|
23
|
+
//# sourceMappingURL=events.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.module.js","sourceRoot":"","sources":["../../../lib/core/events/events.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,yDAA2D;AAC3D,qDAAiD;AAO1C,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IALxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,kCAAkB,CAAC;QAC7B,SAAS,EAAE,CAAC,8BAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,8BAAa,CAAC;KACzB,CAAC;GACW,YAAY,CAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IntegrationEvent } from '../types/integration-event.type';
|
|
2
|
+
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
3
|
+
import { IntegrationEventDispatcher } from '../types/integration-event-dispatcher.type';
|
|
4
|
+
export declare class EventsService {
|
|
5
|
+
private readonly eventEmmiter;
|
|
6
|
+
constructor(eventEmmiter: EventEmitter2);
|
|
7
|
+
private dispatch;
|
|
8
|
+
createDispatcherFor(integrationName: string, integrationType: IntegrationEvent['integrationType']): IntegrationEventDispatcher;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.EventsService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const integration_event_type_1 = require("../types/integration-event.type");
|
|
15
|
+
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
16
|
+
let EventsService = class EventsService {
|
|
17
|
+
eventEmmiter;
|
|
18
|
+
constructor(eventEmmiter) {
|
|
19
|
+
this.eventEmmiter = eventEmmiter;
|
|
20
|
+
}
|
|
21
|
+
dispatch(event) {
|
|
22
|
+
this.eventEmmiter.emit('integration:event', {
|
|
23
|
+
...event,
|
|
24
|
+
createdAt: new Date(),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
createDispatcherFor(integrationName, integrationType) {
|
|
28
|
+
return (event) => {
|
|
29
|
+
this.dispatch({
|
|
30
|
+
...event,
|
|
31
|
+
description: integration_event_type_1.IntegrationEventDescriptions[event.eventType],
|
|
32
|
+
integrationName,
|
|
33
|
+
integrationType,
|
|
34
|
+
createdAt: new Date(),
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.EventsService = EventsService;
|
|
40
|
+
exports.EventsService = EventsService = __decorate([
|
|
41
|
+
(0, common_1.Injectable)(),
|
|
42
|
+
__metadata("design:paramtypes", [event_emitter_1.EventEmitter2])
|
|
43
|
+
], EventsService);
|
|
44
|
+
//# sourceMappingURL=events.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.service.js","sourceRoot":"","sources":["../../../lib/core/events/events.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,4EAGyC;AACzC,yDAAsD;AAI/C,IAAM,aAAa,GAAnB,MAAM,aAAa;IACK;IAA7B,YAA6B,YAA2B;QAA3B,iBAAY,GAAZ,YAAY,CAAe;IAAG,CAAC;IAEpD,QAAQ,CAAC,KAAuB;QACtC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC1C,GAAG,KAAK;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAED,mBAAmB,CACjB,eAAuB,EACvB,eAAoD;QAEpD,OAAO,CACL,KAGC,EACD,EAAE;YACF,IAAI,CAAC,QAAQ,CAAC;gBACZ,GAAG,KAAK;gBACR,WAAW,EAAE,qDAA4B,CAAC,KAAK,CAAC,SAAS,CAAC;gBAC1D,eAAe;gBACf,eAAe;gBACf,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC;CACF,CAAA;AA7BY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAEgC,6BAAa;GAD7C,aAAa,CA6BzB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
__exportStar(require("./events.module"), exports);
|
|
18
|
+
__exportStar(require("./events.service"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/core/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,mDAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './invalid-order.exception';
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
__exportStar(require("./invalid-order.exception"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/core/exceptions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvalidOrderException = void 0;
|
|
4
|
+
class InvalidOrderException extends Error {
|
|
5
|
+
field;
|
|
6
|
+
constructor(message, field) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.field = field;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.InvalidOrderException = InvalidOrderException;
|
|
12
|
+
//# sourceMappingURL=invalid-order.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid-order.exception.js","sourceRoot":"","sources":["../../../lib/core/exceptions/invalid-order.exception.ts"],"names":[],"mappings":";;;AAEA,MAAa,qBAAsB,SAAQ,KAAK;IAG3B;IAFnB,YACE,OAAe,EACE,KAAmB;QAEpC,KAAK,CAAC,OAAO,CAAC,CAAC;QAFE,UAAK,GAAL,KAAK,CAAc;IAGtC,CAAC;CACF;AAPD,sDAOC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
__exportStar(require("./decorators"), exports);
|
|
18
|
+
__exportStar(require("./interfaces"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
20
|
+
__exportStar(require("./exceptions"), exports);
|
|
21
|
+
__exportStar(require("./events"), exports);
|
|
22
|
+
__exportStar(require("./connect.module"), exports);
|
|
23
|
+
__exportStar(require("./connect.service"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,0CAAwB;AACxB,+CAA6B;AAC7B,2CAAyB;AACzB,mDAAiC;AACjC,oDAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadIntegrationFiles(basePath: string, requireFn?: (file: string) => unknown): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadIntegrationFiles = loadIntegrationFiles;
|
|
4
|
+
const fg = require("fast-glob");
|
|
5
|
+
async function loadIntegrationFiles(basePath, requireFn = require) {
|
|
6
|
+
const files = await fg(['**/*.order-output.{js,ts}'], {
|
|
7
|
+
cwd: basePath,
|
|
8
|
+
absolute: true,
|
|
9
|
+
});
|
|
10
|
+
for (const file of files) {
|
|
11
|
+
requireFn(file);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=integration-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-loader.js","sourceRoot":"","sources":["../../lib/core/integration-loader.ts"],"names":[],"mappings":";;AAEA,oDAWC;AAbD,gCAAgC;AAEzB,KAAK,UAAU,oBAAoB,CACxC,QAAgB,EAChB,YAAuC,OAAO;IAE9C,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,CAAC,2BAA2B,CAAC,EAAE;QACpD,GAAG,EAAE,QAAQ;QACb,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACH,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,SAAS,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IntegrationMeta } from './interfaces/integration-meta.interface';
|
|
2
|
+
export declare class IntegrationRegistryService {
|
|
3
|
+
private static integrations;
|
|
4
|
+
static register(meta: IntegrationMeta, integrationClass: Function): void;
|
|
5
|
+
static getIntegrations(): {
|
|
6
|
+
meta: IntegrationMeta;
|
|
7
|
+
integrationClass: Function;
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 IntegrationRegistryService_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.IntegrationRegistryService = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
let IntegrationRegistryService = class IntegrationRegistryService {
|
|
13
|
+
static { IntegrationRegistryService_1 = this; }
|
|
14
|
+
static integrations = new Array();
|
|
15
|
+
static register(meta, integrationClass) {
|
|
16
|
+
const exists = this.integrations.find((entry) => entry.meta.id === meta.id);
|
|
17
|
+
if (exists) {
|
|
18
|
+
common_1.Logger.warn(`Integration already registred: ${meta.id}`, IntegrationRegistryService_1.name);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.integrations.push({ meta, integrationClass });
|
|
22
|
+
}
|
|
23
|
+
static getIntegrations() {
|
|
24
|
+
return this.integrations;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.IntegrationRegistryService = IntegrationRegistryService;
|
|
28
|
+
exports.IntegrationRegistryService = IntegrationRegistryService = IntegrationRegistryService_1 = __decorate([
|
|
29
|
+
(0, common_1.Injectable)()
|
|
30
|
+
], IntegrationRegistryService);
|
|
31
|
+
//# sourceMappingURL=integration-registry.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-registry.service.js","sourceRoot":"","sources":["../../lib/core/integration-registry.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAoD;AAI7C,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;;IAC7B,MAAM,CAAC,YAAY,GAGtB,IAAI,KAAK,EAAE,CAAC;IAEjB,MAAM,CAAC,QAAQ,CAAC,IAAqB,EAAE,gBAA0B;QAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5E,IAAI,MAAM,EAAE,CAAC;YACX,eAAM,CAAC,IAAI,CACT,kCAAkC,IAAI,CAAC,EAAE,EAAE,EAC3C,4BAA0B,CAAC,IAAI,CAChC,CAAC;YACF,OAAO;QACT,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,eAAe;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;;AArBU,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;GACA,0BAA0B,CAsBtC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
__exportStar(require("./integration-meta.interface"), exports);
|
|
18
|
+
__exportStar(require("./order-output-integration.interface"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/core/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,uEAAqD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSONSchema } from 'json-schema-to-ts';
|
|
2
|
+
import { IntegrationType } from '../types/integration-type.type';
|
|
3
|
+
import { IntegrationCategory } from '../types/integration-category.type';
|
|
4
|
+
export interface IntegrationMeta {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
logoUrl: string;
|
|
8
|
+
websiteUrl: string;
|
|
9
|
+
description: string;
|
|
10
|
+
type: IntegrationType;
|
|
11
|
+
category: IntegrationCategory;
|
|
12
|
+
configSchema: JSONSchema;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-meta.interface.js","sourceRoot":"","sources":["../../../lib/core/interfaces/integration-meta.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-output-integration.interface.js","sourceRoot":"","sources":["../../../lib/core/interfaces/order-output-integration.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
__exportStar(require("./integration-event-dispatcher.type"), exports);
|
|
18
|
+
__exportStar(require("./integration-event.type"), exports);
|
|
19
|
+
__exportStar(require("./integration-type.type"), exports);
|
|
20
|
+
__exportStar(require("./order.type"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/core/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAoD;AACpD,2DAAyC;AACzC,0DAAwC;AACxC,+CAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type IntegrationCategory = 'Logistics' | 'POS';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-category.type.js","sourceRoot":"","sources":["../../../lib/core/types/integration-category.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-event-dispatcher.type.js","sourceRoot":"","sources":["../../../lib/core/types/integration-event-dispatcher.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IntegrationType } from './integration-type.type';
|
|
2
|
+
export type IntegrationEventType = 'INTEGRATION_INITIATED' | 'INTEGRATION_REQUESTED' | 'INTEGRATION_PROCESSING' | 'INTEGRATION_COMPLETED' | 'INTEGRATION_FAILED' | 'INTEGRATION_RETRIED' | 'INTEGRATION_CANCELLED';
|
|
3
|
+
export interface IntegrationEvent {
|
|
4
|
+
integrationName: string;
|
|
5
|
+
integrationType: IntegrationType;
|
|
6
|
+
eventType: IntegrationEventType;
|
|
7
|
+
externalId?: string;
|
|
8
|
+
description: string;
|
|
9
|
+
notes?: string;
|
|
10
|
+
metadata?: Record<string, any>;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
}
|
|
13
|
+
export declare const IntegrationEventDescriptions: Record<IntegrationEventType, string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegrationEventDescriptions = void 0;
|
|
4
|
+
exports.IntegrationEventDescriptions = {
|
|
5
|
+
INTEGRATION_INITIATED: 'Integração iniciada',
|
|
6
|
+
INTEGRATION_REQUESTED: 'Solicitação enviada para o sistema integrado',
|
|
7
|
+
INTEGRATION_PROCESSING: 'Processamento da integração em andamento',
|
|
8
|
+
INTEGRATION_COMPLETED: 'Integração concluída com sucesso',
|
|
9
|
+
INTEGRATION_FAILED: 'Falha na integração',
|
|
10
|
+
INTEGRATION_RETRIED: 'Tentativa de nova integração',
|
|
11
|
+
INTEGRATION_CANCELLED: 'Integração cancelada',
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=integration-event.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-event.type.js","sourceRoot":"","sources":["../../../lib/core/types/integration-event.type.ts"],"names":[],"mappings":";;;AAsBa,QAAA,4BAA4B,GAGrC;IACF,qBAAqB,EAAE,qBAAqB;IAC5C,qBAAqB,EAAE,8CAA8C;IACrE,sBAAsB,EAAE,0CAA0C;IAClE,qBAAqB,EAAE,kCAAkC;IACzD,kBAAkB,EAAE,qBAAqB;IACzC,mBAAmB,EAAE,8BAA8B;IACnD,qBAAqB,EAAE,sBAAsB;CAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type IntegrationType = 'OrderOutput';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-type.type.js","sourceRoot":"","sources":["../../../lib/core/types/integration-type.type.ts"],"names":[],"mappings":""}
|