@node-c/core 1.0.0-alpha0 → 1.0.0-alpha2
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 +1 -0
- package/README.md +4 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +534 -0
- package/coverage/coverage-final.json +14 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +191 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/dist/app.d.ts +20 -0
- package/dist/app.js +93 -0
- package/dist/app.js.map +1 -0
- package/dist/common/configProvider/configProvider.definitions.d.ts +141 -0
- package/dist/common/configProvider/configProvider.definitions.js +76 -0
- package/dist/common/configProvider/configProvider.definitions.js.map +1 -0
- package/dist/common/configProvider/configProvider.module.d.ts +5 -0
- package/dist/common/configProvider/configProvider.module.js +44 -0
- package/dist/common/configProvider/configProvider.module.js.map +1 -0
- package/dist/common/configProvider/configProvider.service.d.ts +7 -0
- package/dist/common/configProvider/configProvider.service.js +205 -0
- package/dist/common/configProvider/configProvider.service.js.map +1 -0
- package/dist/common/configProvider/index.d.ts +3 -0
- package/dist/common/configProvider/index.js +20 -0
- package/dist/common/configProvider/index.js.map +1 -0
- package/dist/common/definitions/common.constants.d.ts +5 -0
- package/dist/common/definitions/common.constants.js +10 -0
- package/dist/common/definitions/common.constants.js.map +1 -0
- package/dist/common/definitions/common.definitions.d.ts +6 -0
- package/dist/common/definitions/common.definitions.js +7 -0
- package/dist/common/definitions/common.definitions.js.map +1 -0
- package/dist/common/definitions/common.errors.d.ts +9 -0
- package/dist/common/definitions/common.errors.js +12 -0
- package/dist/common/definitions/common.errors.js.map +1 -0
- package/dist/common/definitions/index.d.ts +3 -0
- package/dist/common/definitions/index.js +20 -0
- package/dist/common/definitions/index.js.map +1 -0
- package/dist/common/utils/index.d.ts +1 -0
- package/dist/common/utils/index.js +18 -0
- package/dist/common/utils/index.js.map +1 -0
- package/dist/common/utils/utils.loadDynamicModules.d.ts +11 -0
- package/dist/common/utils/utils.loadDynamicModules.js +53 -0
- package/dist/common/utils/utils.loadDynamicModules.js.map +1 -0
- package/dist/domain/entityService/domain.entity.service.d.ts +27 -0
- package/dist/domain/entityService/domain.entity.service.definitions.d.ts +30 -0
- package/dist/domain/entityService/domain.entity.service.definitions.js +9 -0
- package/dist/domain/entityService/domain.entity.service.definitions.js.map +1 -0
- package/dist/domain/entityService/domain.entity.service.js +149 -0
- package/dist/domain/entityService/domain.entity.service.js.map +1 -0
- package/dist/domain/entityService/index.d.ts +2 -0
- package/dist/domain/entityService/index.js +19 -0
- package/dist/domain/entityService/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/persistance/entityService/index.d.ts +2 -0
- package/dist/persistance/entityService/index.js +19 -0
- package/dist/persistance/entityService/index.js.map +1 -0
- package/dist/persistance/entityService/persistance.entity.service.d.ts +11 -0
- package/dist/persistance/entityService/persistance.entity.service.definitions.d.ts +62 -0
- package/dist/persistance/entityService/persistance.entity.service.definitions.js +18 -0
- package/dist/persistance/entityService/persistance.entity.service.definitions.js.map +1 -0
- package/dist/persistance/entityService/persistance.entity.service.js +49 -0
- package/dist/persistance/entityService/persistance.entity.service.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.DomainEntityService = void 0;
|
|
24
|
+
const domain_entity_service_definitions_1 = require("./domain.entity.service.definitions");
|
|
25
|
+
const definitions_1 = require("../../common/definitions");
|
|
26
|
+
class DomainEntityService {
|
|
27
|
+
constructor(persistanceEntityService, additionalPersistanceEntityServices) {
|
|
28
|
+
this.persistanceEntityService = persistanceEntityService;
|
|
29
|
+
this.additionalPersistanceEntityServices = additionalPersistanceEntityServices;
|
|
30
|
+
}
|
|
31
|
+
bulkCreate(data, options) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const { persistanceServices = [domain_entity_service_definitions_1.DomainPersistanceEntityServiceType.Main] } = options || {};
|
|
34
|
+
const [firstServiceName, ...otherServiceNames] = persistanceServices;
|
|
35
|
+
const result = yield this.getPersistanceService(firstServiceName).bulkCreate(data);
|
|
36
|
+
return {
|
|
37
|
+
result,
|
|
38
|
+
resultsByService: yield this.runMethodInAdditionalServices(otherServiceNames || [], {
|
|
39
|
+
methodArgs: [result],
|
|
40
|
+
methodName: 'bulkCreate'
|
|
41
|
+
})
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
create(data, options) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const { persistanceServices = [domain_entity_service_definitions_1.DomainPersistanceEntityServiceType.Main] } = options || {};
|
|
48
|
+
const [firstServiceName, ...otherServiceNames] = persistanceServices;
|
|
49
|
+
const result = yield this.getPersistanceService(firstServiceName).create(data);
|
|
50
|
+
return {
|
|
51
|
+
result,
|
|
52
|
+
resultsByService: yield this.runMethodInAdditionalServices(otherServiceNames || [], {
|
|
53
|
+
methodArgs: [result],
|
|
54
|
+
methodName: 'create'
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
delete(options) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const _a = options || {}, { persistanceServices = [domain_entity_service_definitions_1.DomainPersistanceEntityServiceType.Main] } = _a, otherOptions = __rest(_a, ["persistanceServices"]);
|
|
62
|
+
const [firstServiceName, ...otherServiceNames] = persistanceServices;
|
|
63
|
+
const result = yield this.getPersistanceService(firstServiceName).delete(otherOptions);
|
|
64
|
+
return {
|
|
65
|
+
result,
|
|
66
|
+
resultsByService: yield this.runMethodInAdditionalServices(otherServiceNames || [], {
|
|
67
|
+
methodArgs: [otherOptions],
|
|
68
|
+
methodName: 'delete'
|
|
69
|
+
})
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
find(options) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const _a = options || {}, { persistanceServices = [domain_entity_service_definitions_1.DomainPersistanceEntityServiceType.Main] } = _a, otherOptions = __rest(_a, ["persistanceServices"]);
|
|
76
|
+
const [firstServiceName, ...otherServiceNames] = persistanceServices;
|
|
77
|
+
const result = yield this.getPersistanceService(firstServiceName).find(otherOptions);
|
|
78
|
+
return {
|
|
79
|
+
result,
|
|
80
|
+
resultsByService: yield this.runMethodInAdditionalServices(otherServiceNames || [], {
|
|
81
|
+
methodArgs: [otherOptions],
|
|
82
|
+
methodName: 'find'
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
findOne(options) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
const _a = options || {}, { persistanceServices = [domain_entity_service_definitions_1.DomainPersistanceEntityServiceType.Main] } = _a, otherOptions = __rest(_a, ["persistanceServices"]);
|
|
90
|
+
const [firstServiceName, ...otherServiceNames] = persistanceServices;
|
|
91
|
+
const result = yield this.getPersistanceService(firstServiceName).findOne(otherOptions);
|
|
92
|
+
return {
|
|
93
|
+
result,
|
|
94
|
+
resultsByService: yield this.runMethodInAdditionalServices(otherServiceNames || [], {
|
|
95
|
+
methodArgs: [otherOptions],
|
|
96
|
+
methodName: 'findOne'
|
|
97
|
+
})
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
getPersistanceService(serviceName) {
|
|
102
|
+
var _a;
|
|
103
|
+
if (serviceName === domain_entity_service_definitions_1.DomainPersistanceEntityServiceType.Main) {
|
|
104
|
+
return this.persistanceEntityService;
|
|
105
|
+
}
|
|
106
|
+
const service = (_a = this.additionalPersistanceEntityServices) === null || _a === void 0 ? void 0 : _a[serviceName];
|
|
107
|
+
if (!service) {
|
|
108
|
+
throw new definitions_1.ApplicationError(`PersistanceEntityService ${serviceName} does not exist for DomainEntityService ${this.persistanceEntityService.getEntityName()}.`);
|
|
109
|
+
}
|
|
110
|
+
return service;
|
|
111
|
+
}
|
|
112
|
+
runMethodInAdditionalServices(serviceNames, options) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
if (!serviceNames.length) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const { methodArgs = [], methodName } = options;
|
|
118
|
+
const returnDataByService = {};
|
|
119
|
+
if (!this.additionalPersistanceEntityServices) {
|
|
120
|
+
throw new definitions_1.ApplicationError(`No additional PersistanceEntityServices exist for DomainEntityService ${this.persistanceEntityService.getEntityName()}.`);
|
|
121
|
+
}
|
|
122
|
+
for (const i in serviceNames) {
|
|
123
|
+
const serviceName = serviceNames[i];
|
|
124
|
+
const service = this.additionalPersistanceEntityServices[serviceName];
|
|
125
|
+
if (!service) {
|
|
126
|
+
throw new definitions_1.ApplicationError(`PersistanceEntityService ${serviceName} does not exist for DomainEntityService ${this.persistanceEntityService.getEntityName()}.`);
|
|
127
|
+
}
|
|
128
|
+
returnDataByService[serviceName] = (yield service[methodName].apply(service, methodArgs));
|
|
129
|
+
}
|
|
130
|
+
return returnDataByService;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
update(data, options) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
const { persistanceServices = [domain_entity_service_definitions_1.DomainPersistanceEntityServiceType.Main] } = options, otherOptions = __rest(options, ["persistanceServices"]);
|
|
136
|
+
const [firstServiceName, ...otherServiceNames] = persistanceServices;
|
|
137
|
+
const result = yield this.getPersistanceService(firstServiceName).update(data, otherOptions);
|
|
138
|
+
return {
|
|
139
|
+
result,
|
|
140
|
+
resultsByService: yield this.runMethodInAdditionalServices(otherServiceNames || [], {
|
|
141
|
+
methodArgs: [data, otherOptions],
|
|
142
|
+
methodName: 'update'
|
|
143
|
+
})
|
|
144
|
+
};
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.DomainEntityService = DomainEntityService;
|
|
149
|
+
//# sourceMappingURL=domain.entity.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain.entity.service.js","sourceRoot":"","sources":["../../../src/domain/entityService/domain.entity.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,2FAiB6C;AAE7C,0DAA2E;AAI3E,MAAa,mBAAmB;IAc9B,YAEY,wBAAuC,EAEvC,mCAA8D;QAF9D,6BAAwB,GAAx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AAO,GAAG,IAAI,CAAC,mCAAmC,CAAC,WAAW,CAAC,CAAC;gBACtE,IAAI,CAAC,OAAO,EAAE;oBACZ,MAAM,IAAI,8BAAgB,CACxB,4BAA4B,WAAW,2CAA2C,IAAI,CAAC,wBAAwB,CAAC,aAAa,EAAE,GAAG,CACnI,CAAC;iBACH;gBACD,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,MAClC,OAAO,CAAC,UAAoD,CAG7D,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,CAAsB,CAAC;aACpD;YACD,OAAO,mBAAmB,CAAC;QAC7B,CAAC;KAAA;IAIK,MAAM,CAAC,IAAoB,EAAE,OAA4B;;YAC7D,MAAM,EAAE,mBAAmB,GAAG,CAAC,sEAAkC,CAAC,IAAI,CAAC,KAAsB,OAAO,EAAxB,YAAY,UAAK,OAAO,EAA9F,uBAAoF,CAAU,CAAC;YACrG,MAAM,CAAC,gBAAgB,EAAE,GAAG,iBAAiB,CAAC,GAAG,mBAAmB,CAAC;YACrE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;YAC7F,OAAO;gBACL,MAAM;gBACN,gBAAgB,EAAE,MAAM,IAAI,CAAC,6BAA6B,CAAC,iBAAiB,IAAI,EAAE,EAAE;oBAClF,UAAU,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC;oBAChC,UAAU,EAAE,QAAQ;iBACrB,CAAC;aACH,CAAC;QACJ,CAAC;KAAA;CACF;AAnKD,kDAmKC"}
|
|
@@ -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("./domain.entity.service"), exports);
|
|
18
|
+
__exportStar(require("./domain.entity.service.definitions"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/entityService/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,sEAAoD"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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("./app"), exports);
|
|
18
|
+
__exportStar(require("./common/configProvider"), exports);
|
|
19
|
+
__exportStar(require("./common/definitions"), exports);
|
|
20
|
+
__exportStar(require("./common/utils"), exports);
|
|
21
|
+
__exportStar(require("./domain/entityService"), exports);
|
|
22
|
+
__exportStar(require("./persistance/entityService"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,0DAAwC;AACxC,uDAAqC;AACrC,iDAA+B;AAC/B,yDAAuC;AACvC,8DAA4C"}
|
|
@@ -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("./persistance.entity.service"), exports);
|
|
18
|
+
__exportStar(require("./persistance.entity.service.definitions"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/persistance/entityService/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,2EAAyD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PersistanceDeleteOptions, PersistanceDeleteResult, PersistanceFindOneOptions, PersistanceFindOptions, PersistanceFindResults, PersistanceUpdateOptions, PersistanceUpdateResult } from './persistance.entity.service.definitions';
|
|
2
|
+
export declare class PersistanceEntityService<Entity> {
|
|
3
|
+
bulkCreate(_data: Partial<Entity>[], _options?: unknown): Promise<Entity[]>;
|
|
4
|
+
create(_data: Partial<Entity>, _options?: unknown): Promise<Entity>;
|
|
5
|
+
count(_options: PersistanceFindOptions): Promise<number | undefined>;
|
|
6
|
+
delete(_options: PersistanceDeleteOptions): Promise<PersistanceDeleteResult>;
|
|
7
|
+
find(_options: PersistanceFindOptions): Promise<PersistanceFindResults<Entity>>;
|
|
8
|
+
findOne(_options: PersistanceFindOneOptions): Promise<Entity | null>;
|
|
9
|
+
getEntityName(): Promise<string>;
|
|
10
|
+
update(_data: Partial<Entity>, _options: PersistanceUpdateOptions): Promise<PersistanceUpdateResult<Entity>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { GenericObject } from '../../common/definitions';
|
|
2
|
+
export interface PersistanceCountOptions {
|
|
3
|
+
filters?: GenericObject;
|
|
4
|
+
findAll?: boolean;
|
|
5
|
+
withDeleted?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface PersistanceDeleteOptions {
|
|
8
|
+
filters: GenericObject;
|
|
9
|
+
softDelete?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface PersistanceDeleteResult {
|
|
12
|
+
count?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface PersistanceFindOneOptions {
|
|
15
|
+
filters: GenericObject;
|
|
16
|
+
include?: string[];
|
|
17
|
+
orderBy?: GenericObject<string>;
|
|
18
|
+
select?: string[];
|
|
19
|
+
selectOperator?: PersistanceSelectOperator;
|
|
20
|
+
withDeleted?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface PersistanceFindOptions {
|
|
23
|
+
filters?: GenericObject;
|
|
24
|
+
findAll?: boolean;
|
|
25
|
+
include?: string[];
|
|
26
|
+
orderBy?: GenericObject<string>;
|
|
27
|
+
page?: number;
|
|
28
|
+
perPage?: number;
|
|
29
|
+
select?: string[];
|
|
30
|
+
withDeleted?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface PersistanceFindResults<Item> {
|
|
33
|
+
items: Item[];
|
|
34
|
+
more: boolean;
|
|
35
|
+
page: number;
|
|
36
|
+
perPage: number;
|
|
37
|
+
}
|
|
38
|
+
export interface PersistanceNumberItem {
|
|
39
|
+
deleted?: boolean;
|
|
40
|
+
value: number;
|
|
41
|
+
}
|
|
42
|
+
export declare enum PersistanceSelectOperator {
|
|
43
|
+
Between = "$between",
|
|
44
|
+
Contains = "$contains",
|
|
45
|
+
Equals = "$eq",
|
|
46
|
+
GreaterThan = "$gt",
|
|
47
|
+
GreaterThanOrEqual = "$gte",
|
|
48
|
+
LessThan = "$lt",
|
|
49
|
+
LessThanOrEqual = "$lte",
|
|
50
|
+
Like = "$like",
|
|
51
|
+
ILike = "$ilike",
|
|
52
|
+
Not = "$not",
|
|
53
|
+
Or = "$or"
|
|
54
|
+
}
|
|
55
|
+
export interface PersistanceUpdateOptions {
|
|
56
|
+
filters: GenericObject;
|
|
57
|
+
returnData?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface PersistanceUpdateResult<Item> {
|
|
60
|
+
count?: number;
|
|
61
|
+
items?: Item[];
|
|
62
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PersistanceSelectOperator = void 0;
|
|
4
|
+
var PersistanceSelectOperator;
|
|
5
|
+
(function (PersistanceSelectOperator) {
|
|
6
|
+
PersistanceSelectOperator["Between"] = "$between";
|
|
7
|
+
PersistanceSelectOperator["Contains"] = "$contains";
|
|
8
|
+
PersistanceSelectOperator["Equals"] = "$eq";
|
|
9
|
+
PersistanceSelectOperator["GreaterThan"] = "$gt";
|
|
10
|
+
PersistanceSelectOperator["GreaterThanOrEqual"] = "$gte";
|
|
11
|
+
PersistanceSelectOperator["LessThan"] = "$lt";
|
|
12
|
+
PersistanceSelectOperator["LessThanOrEqual"] = "$lte";
|
|
13
|
+
PersistanceSelectOperator["Like"] = "$like";
|
|
14
|
+
PersistanceSelectOperator["ILike"] = "$ilike";
|
|
15
|
+
PersistanceSelectOperator["Not"] = "$not";
|
|
16
|
+
PersistanceSelectOperator["Or"] = "$or";
|
|
17
|
+
})(PersistanceSelectOperator = exports.PersistanceSelectOperator || (exports.PersistanceSelectOperator = {}));
|
|
18
|
+
//# sourceMappingURL=persistance.entity.service.definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistance.entity.service.definitions.js","sourceRoot":"","sources":["../../../src/persistance/entityService/persistance.entity.service.definitions.ts"],"names":[],"mappings":";;;AAiDA,IAAY,yBAuBX;AAvBD,WAAY,yBAAyB;IAEnC,iDAAoB,CAAA;IAEpB,mDAAsB,CAAA;IAEtB,2CAAc,CAAA;IAEd,gDAAmB,CAAA;IAEnB,wDAA2B,CAAA;IAE3B,6CAAgB,CAAA;IAEhB,qDAAwB,CAAA;IAExB,2CAAc,CAAA;IAEd,6CAAgB,CAAA;IAEhB,yCAAY,CAAA;IAEZ,uCAAU,CAAA;AACZ,CAAC,EAvBW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAuBpC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PersistanceEntityService = void 0;
|
|
13
|
+
const definitions_1 = require("../../common/definitions");
|
|
14
|
+
class PersistanceEntityService {
|
|
15
|
+
bulkCreate(_data, _options) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
throw new definitions_1.ApplicationError(`Method bulkCreate not implemented for class ${typeof this}.`);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
create(_data, _options) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
throw new definitions_1.ApplicationError(`Method create not implemented for class ${typeof this}.`);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
count(_options) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
throw new definitions_1.ApplicationError(`Method count not implemented for class ${typeof this}.`);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
delete(_options) {
|
|
31
|
+
throw new definitions_1.ApplicationError(`Method delete not implemented for class ${typeof this}.`);
|
|
32
|
+
}
|
|
33
|
+
find(_options) {
|
|
34
|
+
throw new definitions_1.ApplicationError(`Method find not implemented for class ${typeof this}.`);
|
|
35
|
+
}
|
|
36
|
+
findOne(_options) {
|
|
37
|
+
throw new definitions_1.ApplicationError(`Method findOne not implemented for class ${typeof this}.`);
|
|
38
|
+
}
|
|
39
|
+
getEntityName() {
|
|
40
|
+
throw new definitions_1.ApplicationError(`Method getEntityName not implemented for class ${typeof this}.`);
|
|
41
|
+
}
|
|
42
|
+
update(_data, _options) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
throw new definitions_1.ApplicationError(`Method update not implemented for class ${typeof this}.`);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.PersistanceEntityService = PersistanceEntityService;
|
|
49
|
+
//# sourceMappingURL=persistance.entity.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistance.entity.service.js","sourceRoot":"","sources":["../../../src/persistance/entityService/persistance.entity.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAUA,0DAA4D;AAM5D,MAAa,wBAAwB;IAEtB,UAAU,CAAC,KAAwB,EAAE,QAAkB;;YAClE,MAAM,IAAI,8BAAgB,CAAC,+CAA+C,OAAO,IAAI,GAAG,CAAC,CAAC;QAC5F,CAAC;KAAA;IAGY,MAAM,CAAC,KAAsB,EAAE,QAAkB;;YAC5D,MAAM,IAAI,8BAAgB,CAAC,2CAA2C,OAAO,IAAI,GAAG,CAAC,CAAC;QACxF,CAAC;KAAA;IAGY,KAAK,CAAC,QAAgC;;YACjD,MAAM,IAAI,8BAAgB,CAAC,0CAA0C,OAAO,IAAI,GAAG,CAAC,CAAC;QACvF,CAAC;KAAA;IAGM,MAAM,CAAC,QAAkC;QAC9C,MAAM,IAAI,8BAAgB,CAAC,2CAA2C,OAAO,IAAI,GAAG,CAAC,CAAC;IACxF,CAAC;IAGM,IAAI,CAAC,QAAgC;QAC1C,MAAM,IAAI,8BAAgB,CAAC,yCAAyC,OAAO,IAAI,GAAG,CAAC,CAAC;IACtF,CAAC;IAGM,OAAO,CAAC,QAAmC;QAChD,MAAM,IAAI,8BAAgB,CAAC,4CAA4C,OAAO,IAAI,GAAG,CAAC,CAAC;IACzF,CAAC;IAGM,aAAa;QAClB,MAAM,IAAI,8BAAgB,CAAC,kDAAkD,OAAO,IAAI,GAAG,CAAC,CAAC;IAC/F,CAAC;IAEY,MAAM,CAEjB,KAAsB,EAEtB,QAAkC;;YAElC,MAAM,IAAI,8BAAgB,CAAC,2CAA2C,OAAO,IAAI,GAAG,CAAC,CAAC;QACxF,CAAC;KAAA;CACF;AA5CD,4DA4CC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-c/core",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-alpha2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc -p tsconfig.build.json",
|
|
8
8
|
"check-types": "tsc -p tsconfig.build.json --noEmit",
|
|
9
9
|
"dev": "tsc -p tsconfig.build.json --watch",
|
|
10
|
+
"publish-package": "rm -rf dist/* && rm -f *.tsbuildinfo && npm run build && npm publish --access public",
|
|
10
11
|
"test": "vitest --config src/vitest.config.ts",
|
|
11
12
|
"test:coverage": "vitest --config src/vitest.config.ts --coverage"
|
|
12
13
|
},
|