@futdevpro/nts-dynamo 1.5.50 → 1.5.52
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/lib/_models/dynamo-nts-endpoint-params.js +3 -2
- package/lib/_models/dynamo-nts-endpoint-params.js.map +1 -1
- package/lib/_services/dynamo-nts-api.service.d.ts +1 -0
- package/lib/_services/dynamo-nts-api.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-api.service.js +6 -5
- package/lib/_services/dynamo-nts-api.service.js.map +1 -1
- package/lib/_services/dynamo-nts-app-extended.d.ts +87 -7
- package/lib/_services/dynamo-nts-app-extended.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-app-extended.js +87 -7
- package/lib/_services/dynamo-nts-app-extended.js.map +1 -1
- package/lib/_services/dynamo-nts-app.d.ts +131 -22
- package/lib/_services/dynamo-nts-app.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-app.js +104 -1
- package/lib/_services/dynamo-nts-app.js.map +1 -1
- package/lib/_services/dynamo-nts-auth.service.d.ts +79 -5
- package/lib/_services/dynamo-nts-auth.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-auth.service.js +3 -2
- package/lib/_services/dynamo-nts-auth.service.js.map +1 -1
- package/lib/_services/dynamo-nts-data.service.d.ts +25 -1
- package/lib/_services/dynamo-nts-data.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-data.service.js +98 -70
- package/lib/_services/dynamo-nts-data.service.js.map +1 -1
- package/lib/_services/dynamo-nts-db.service.d.ts +165 -119
- package/lib/_services/dynamo-nts-db.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-db.service.js +348 -293
- package/lib/_services/dynamo-nts-db.service.js.map +1 -1
- package/lib/_services/dynamo-nts-email.service.d.ts +1 -0
- package/lib/_services/dynamo-nts-email.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-email.service.js +5 -4
- package/lib/_services/dynamo-nts-email.service.js.map +1 -1
- package/lib/_services/dynamo-nts-routing-module.service.d.ts +40 -0
- package/lib/_services/dynamo-nts-routing-module.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-routing-module.service.js +43 -3
- package/lib/_services/dynamo-nts-routing-module.service.js.map +1 -1
- package/lib/_services/dynamo-nts-socket.service.d.ts +1 -0
- package/lib/_services/dynamo-nts-socket.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-socket.service.js +6 -2
- package/lib/_services/dynamo-nts-socket.service.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -12
- package/src/_models/dynamo-nts-endpoint-params.ts +2 -2
- package/src/_services/dynamo-nts-api.service.ts +7 -5
- package/src/_services/dynamo-nts-app-extended.ts +87 -7
- package/src/_services/dynamo-nts-app.ts +131 -22
- package/src/_services/dynamo-nts-auth.service.ts +83 -7
- package/src/_services/dynamo-nts-data.service.ts +100 -71
- package/src/_services/dynamo-nts-db.service.ts +377 -297
- package/src/_services/dynamo-nts-email.service.ts +6 -4
- package/src/_services/dynamo-nts-routing-module.service.ts +44 -3
- package/src/_services/dynamo-nts-socket.service.ts +13 -7
- package/futdevpro-nts-dynamo-01.05.40.tgz +0 -0
- package/futdevpro-nts-dynamo-01.05.41.tgz +0 -0
- package/futdevpro-nts-dynamo-01.05.42.tgz +0 -0
- package/futdevpro-nts-dynamo-01.05.43.tgz +0 -0
- package/futdevpro-nts-dynamo-01.05.44.tgz +0 -0
- package/futdevpro-nts-dynamo-01.05.45.tgz +0 -0
- package/futdevpro-nts-dynamo-01.05.47.tgz +0 -0
- package/futdevpro-nts-dynamo-01.05.49.tgz +0 -0
- package/futdevpro-nts-dynamo-01.05.50.tgz +0 -0
- package/lib/_constants/dynamo-nts-global.settings.d.ts +0 -3
- package/lib/_constants/dynamo-nts-global.settings.d.ts.map +0 -1
- package/lib/_constants/dynamo-nts-global.settings.js +0 -18
- package/lib/_constants/dynamo-nts-global.settings.js.map +0 -1
- package/lib/_constants/dynamobe-global.settings.d.ts +0 -3
- package/lib/_constants/dynamobe-global.settings.d.ts.map +0 -1
- package/lib/_constants/dynamobe-global.settings.js +0 -13
- package/lib/_constants/dynamobe-global.settings.js.map +0 -1
- package/lib/_enums/dynamobe-data-service-function.enum.d.ts +0 -8
- package/lib/_enums/dynamobe-data-service-function.enum.d.ts.map +0 -1
- package/lib/_enums/dynamobe-data-service-function.enum.js +0 -15
- package/lib/_enums/dynamobe-data-service-function.enum.js.map +0 -1
- package/lib/_enums/dynamobe-route-security.enum.d.ts +0 -6
- package/lib/_enums/dynamobe-route-security.enum.d.ts.map +0 -1
- package/lib/_enums/dynamobe-route-security.enum.js +0 -10
- package/lib/_enums/dynamobe-route-security.enum.js.map +0 -1
- package/lib/_enums/log-style.enum.d.ts +0 -26
- package/lib/_enums/log-style.enum.d.ts.map +0 -1
- package/lib/_enums/log-style.enum.js +0 -30
- package/lib/_enums/log-style.enum.js.map +0 -1
- package/lib/_models/dynamo-module-settings.d.ts +0 -4
- package/lib/_models/dynamo-module-settings.d.ts.map +0 -1
- package/lib/_models/dynamo-module-settings.js +0 -10
- package/lib/_models/dynamo-module-settings.js.map +0 -1
- package/lib/_models/dynamo-nts-socket-module-settings.d.ts +0 -19
- package/lib/_models/dynamo-nts-socket-module-settings.d.ts.map +0 -1
- package/lib/_models/dynamo-nts-socket-module-settings.js +0 -27
- package/lib/_models/dynamo-nts-socket-module-settings.js.map +0 -1
- package/lib/_models/dynamobe-api-call-params.d.ts +0 -37
- package/lib/_models/dynamobe-api-call-params.d.ts.map +0 -1
- package/lib/_models/dynamobe-api-call-params.js +0 -29
- package/lib/_models/dynamobe-api-call-params.js.map +0 -1
- package/lib/_models/dynamobe-app-params.d.ts +0 -18
- package/lib/_models/dynamobe-app-params.d.ts.map +0 -1
- package/lib/_models/dynamobe-app-params.js +0 -17
- package/lib/_models/dynamobe-app-params.js.map +0 -1
- package/lib/_models/dynamobe-data-model-params.d.ts +0 -1
- package/lib/_models/dynamobe-data-model-params.d.ts.map +0 -1
- package/lib/_models/dynamobe-data-model-params.js +0 -25
- package/lib/_models/dynamobe-data-model-params.js.map +0 -1
- package/lib/_models/dynamobe-endpoint-params.d.ts +0 -46
- package/lib/_models/dynamobe-endpoint-params.d.ts.map +0 -1
- package/lib/_models/dynamobe-endpoint-params.js +0 -117
- package/lib/_models/dynamobe-endpoint-params.js.map +0 -1
- package/lib/_models/dynamobe-global-settings.d.ts +0 -13
- package/lib/_models/dynamobe-global-settings.d.ts.map +0 -1
- package/lib/_models/dynamobe-global-settings.js +0 -3
- package/lib/_models/dynamobe-global-settings.js.map +0 -1
- package/lib/_modules/data-models.index.d.ts +0 -3
- package/lib/_modules/data-models.index.d.ts.map +0 -1
- package/lib/_modules/data-models.index.js +0 -6
- package/lib/_modules/data-models.index.js.map +0 -1
- package/lib/_services/dynamobe-api.service.d.ts +0 -19
- package/lib/_services/dynamobe-api.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-api.service.js +0 -167
- package/lib/_services/dynamobe-api.service.js.map +0 -1
- package/lib/_services/dynamobe-app.d.ts +0 -129
- package/lib/_services/dynamobe-app.d.ts.map +0 -1
- package/lib/_services/dynamobe-app.js +0 -238
- package/lib/_services/dynamobe-app.js.map +0 -1
- package/lib/_services/dynamobe-auth.service.d.ts +0 -54
- package/lib/_services/dynamobe-auth.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-auth.service.js +0 -46
- package/lib/_services/dynamobe-auth.service.js.map +0 -1
- package/lib/_services/dynamobe-controller.service.d.ts +0 -14
- package/lib/_services/dynamobe-controller.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-controller.service.js +0 -21
- package/lib/_services/dynamobe-controller.service.js.map +0 -1
- package/lib/_services/dynamobe-data.service.d.ts +0 -54
- package/lib/_services/dynamobe-data.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-data.service.js +0 -301
- package/lib/_services/dynamobe-data.service.js.map +0 -1
- package/lib/_services/dynamobe-db-service-collection.service.d.ts +0 -9
- package/lib/_services/dynamobe-db-service-collection.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-db-service-collection.service.js +0 -11
- package/lib/_services/dynamobe-db-service-collection.service.js.map +0 -1
- package/lib/_services/dynamobe-db.service.d.ts +0 -244
- package/lib/_services/dynamobe-db.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-db.service.js +0 -759
- package/lib/_services/dynamobe-db.service.js.map +0 -1
- package/lib/_services/dynamobe-email-service-collection.service.d.ts +0 -19
- package/lib/_services/dynamobe-email-service-collection.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-email-service-collection.service.js +0 -21
- package/lib/_services/dynamobe-email-service-collection.service.js.map +0 -1
- package/lib/_services/dynamobe-email.service.d.ts +0 -56
- package/lib/_services/dynamobe-email.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-email.service.js +0 -194
- package/lib/_services/dynamobe-email.service.js.map +0 -1
- package/lib/_services/dynamobe-global.service.d.ts +0 -62
- package/lib/_services/dynamobe-global.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-global.service.js +0 -107
- package/lib/_services/dynamobe-global.service.js.map +0 -1
- package/lib/_services/dynamobe-routing-module.service.d.ts +0 -42
- package/lib/_services/dynamobe-routing-module.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-routing-module.service.js +0 -146
- package/lib/_services/dynamobe-routing-module.service.js.map +0 -1
- package/lib/_services/dynamobe-shared-be.service.d.ts +0 -8
- package/lib/_services/dynamobe-shared-be.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-shared-be.service.js +0 -45
- package/lib/_services/dynamobe-shared-be.service.js.map +0 -1
- package/lib/_services/dynamobe-shared.service.d.ts +0 -26
- package/lib/_services/dynamobe-shared.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-shared.service.js +0 -63
- package/lib/_services/dynamobe-shared.service.js.map +0 -1
- package/lib/_services/dynamobe-singleton.service.d.ts +0 -9
- package/lib/_services/dynamobe-singleton.service.d.ts.map +0 -1
- package/lib/_services/dynamobe-singleton.service.js +0 -19
- package/lib/_services/dynamobe-singleton.service.js.map +0 -1
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DynamoBEDataService = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
6
|
-
const dynamobe_global_service_1 = require("./dynamobe-global.service");
|
|
7
|
-
class DynamoBEDataService {
|
|
8
|
-
constructor(data, dataParams, issuer) {
|
|
9
|
-
this.dataList = [];
|
|
10
|
-
this.dataDBService = dynamobe_global_service_1.DBE_Global_S.getDBService(dataParams);
|
|
11
|
-
this.data = data;
|
|
12
|
-
this.dataParams = dataParams;
|
|
13
|
-
// this.dataModelParams = dataParams.modelParams;
|
|
14
|
-
this.lookForDependencyDataSettings();
|
|
15
|
-
this.issuer = issuer;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* returns all data from database to service dataList
|
|
19
|
-
*/
|
|
20
|
-
getAll() {
|
|
21
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
try {
|
|
23
|
-
yield this.dataDBService.getAll().then((dataList) => {
|
|
24
|
-
this.dataList = dataList;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
29
|
-
status: 417, message: 'getAll was unsuccessful',
|
|
30
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-130`,
|
|
31
|
-
error: error
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* returns data from database by id
|
|
38
|
-
*/
|
|
39
|
-
getDataById(id, dontSetToService) {
|
|
40
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
try {
|
|
42
|
-
if (id || this.data._id) {
|
|
43
|
-
let dataExists;
|
|
44
|
-
yield this.dataDBService.getDataById(id ? id : this.data._id).then((data) => {
|
|
45
|
-
if (!dontSetToService) {
|
|
46
|
-
this.data = data;
|
|
47
|
-
}
|
|
48
|
-
dataExists = data;
|
|
49
|
-
});
|
|
50
|
-
return dataExists;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
54
|
-
status: 417, message: `ID is missing! (maybe you wanted to use getDataByDependencyId instead...)`,
|
|
55
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-131B`,
|
|
56
|
-
error: new Error()
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
62
|
-
status: 417, message: 'getDataById was unsuccessful',
|
|
63
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-131A`,
|
|
64
|
-
error: error
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* returns data from database by dependencyId to the service
|
|
71
|
-
* @param dependencyId
|
|
72
|
-
*/
|
|
73
|
-
getDataByDependencyId(dependencyId, dontSetToService) {
|
|
74
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
try {
|
|
76
|
-
if (this.depKey) {
|
|
77
|
-
if (dependencyId || this.data[this.depKey]) {
|
|
78
|
-
let dataExists;
|
|
79
|
-
yield this.dataDBService.getDataByDependencyId(dependencyId ? dependencyId : this.data[this.depKey]).then((data) => {
|
|
80
|
-
if (!dontSetToService) {
|
|
81
|
-
this.data = data;
|
|
82
|
-
}
|
|
83
|
-
dataExists = data;
|
|
84
|
-
});
|
|
85
|
-
return dataExists;
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
89
|
-
status: 417, message: `${this.depKey} is missing!`,
|
|
90
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-132C`,
|
|
91
|
-
error: new Error()
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
97
|
-
status: 417, message: 'dependencyDataIdKey is missing from service!',
|
|
98
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-132B`,
|
|
99
|
-
error: new Error()
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
catch (error) {
|
|
104
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
105
|
-
status: 417, message: 'getDataByDependencyId was unsuccessful',
|
|
106
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-132A`,
|
|
107
|
-
error: error
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* returns dataList from database by dependencyId to the service
|
|
114
|
-
* @param dependencyId
|
|
115
|
-
*/
|
|
116
|
-
getDataListByDependencyId(dependencyId) {
|
|
117
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
118
|
-
try {
|
|
119
|
-
if (this.depKey) {
|
|
120
|
-
if (dependencyId || this.data[this.depKey]) {
|
|
121
|
-
yield this.dataDBService.getDataListByDependencyId(dependencyId ? dependencyId : this.data[this.depKey]).then((data) => {
|
|
122
|
-
this.dataList = data;
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
127
|
-
status: 417, message: `${this.depKey} is missing!`,
|
|
128
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-133C`,
|
|
129
|
-
error: new Error()
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
135
|
-
status: 417, message: 'dependencyDataIdKey is missing from service!',
|
|
136
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-133B`,
|
|
137
|
-
error: new Error()
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
catch (error) {
|
|
142
|
-
throw new fsm_dynamo_1.DynamoBEError({ status: 417,
|
|
143
|
-
message: 'getDataListByDependencyId was unsuccessful',
|
|
144
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-133A`,
|
|
145
|
-
error: error
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* modifies data if the data have ID and already exists in the DB,
|
|
152
|
-
* creates new if the ID is not present or cant find in DB,
|
|
153
|
-
* and if dependency data setted up, will check before creation
|
|
154
|
-
*/
|
|
155
|
-
saveData() {
|
|
156
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
157
|
-
try {
|
|
158
|
-
if (this.data._id) {
|
|
159
|
-
// check if already exists
|
|
160
|
-
let dataExists;
|
|
161
|
-
yield this.getDataById(null, true).then((data) => {
|
|
162
|
-
dataExists = data;
|
|
163
|
-
}).catch(() => { });
|
|
164
|
-
if (!dataExists) {
|
|
165
|
-
// if data not exists check that dependency already exists for this
|
|
166
|
-
if (this.depKey) {
|
|
167
|
-
if (this.data[this.depKey]) {
|
|
168
|
-
let dependencyExists = false;
|
|
169
|
-
yield this.getDependencyDataDBService().getDataById(this.data[this.depKey]).then((dep) => {
|
|
170
|
-
dependencyExists = !!dep;
|
|
171
|
-
});
|
|
172
|
-
if (!dependencyExists) {
|
|
173
|
-
throw new fsm_dynamo_1.DynamoBEError({ status: 417,
|
|
174
|
-
message: `saveData was unsuccessful: dependency data not exists (key: ${this.depKey}, id: ${this.data[this.depKey]})`,
|
|
175
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-333A`,
|
|
176
|
-
error: new Error()
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
throw new fsm_dynamo_1.DynamoBEError({ status: 417,
|
|
182
|
-
message: `saveData was unsuccessful: dependency data id missing from data (key: ${this.depKey})`,
|
|
183
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-333B`,
|
|
184
|
-
error: new Error()
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
// if data not exists create new data
|
|
189
|
-
yield this.dataDBService.createData(this.data, this.issuer).then((data) => {
|
|
190
|
-
this.data = data;
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
// if data exists do modify
|
|
195
|
-
yield this.dataDBService.modifyData(this.data, this.issuer).then((data) => {
|
|
196
|
-
this.data = data;
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
// if ID is not present, data not exists, create new data
|
|
202
|
-
yield this.dataDBService.createData(this.data, this.issuer).then((data) => {
|
|
203
|
-
this.data = data;
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
catch (error) {
|
|
208
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
209
|
-
status: 417, message: `modifyData was unsuccessful (${this.dataParams.dataName})`,
|
|
210
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-222`,
|
|
211
|
-
error: error
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* permanently deletes data from database by data._id
|
|
218
|
-
*/
|
|
219
|
-
deleteData() {
|
|
220
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
221
|
-
try {
|
|
222
|
-
if (this.data._id) {
|
|
223
|
-
yield this.dataDBService.deleteDataById(this.data._id);
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
throw new fsm_dynamo_1.DynamoBEError({ status: 417, message: 'ID is missing!' });
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
catch (error) {
|
|
230
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
231
|
-
status: 417, message: 'deleteData was unsuccessful',
|
|
232
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-223`,
|
|
233
|
-
error: error
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* validation of data, for modify and create, by the ModelParams
|
|
240
|
-
*/
|
|
241
|
-
validateForSave() {
|
|
242
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
243
|
-
try {
|
|
244
|
-
for (let i = 0; i < this.dataParams.modelParams.length; i++) {
|
|
245
|
-
// basic required validations
|
|
246
|
-
if ((this.dataParams.modelParams[i].required && (this.data[this.dataParams.modelParams[i].key] === null || this.data[this.dataParams.modelParams[i].key] === undefined)) ||
|
|
247
|
-
(this.dataParams.modelParams[i].index && (this.data[this.dataParams.modelParams[i].key] === null || this.data[this.dataParams.modelParams[i].key] === undefined))) {
|
|
248
|
-
throw new fsm_dynamo_1.DynamoBEError({ status: 422, message: `${this.dataParams.modelParams[i].key} is missing! (${this.dataParams.modelParams[i].required ? 'required' : 'index'})` });
|
|
249
|
-
}
|
|
250
|
-
// specific Date validation
|
|
251
|
-
if (this.dataParams.modelParams[i].type === 'Date' && !(new Date(this.data[this.dataParams.modelParams[i].key]) instanceof Date)) {
|
|
252
|
-
throw new fsm_dynamo_1.DynamoBEError({ status: 422, message: `${this.dataParams.modelParams[i].key} is not a date!` });
|
|
253
|
-
}
|
|
254
|
-
// call additional validators
|
|
255
|
-
if (this.dataParams.modelParams[i].additionalValidators) {
|
|
256
|
-
for (let j = 0; j < this.dataParams.modelParams[i].additionalValidators.length; j++) {
|
|
257
|
-
this.dataParams.modelParams[i].additionalValidators[j](this.data[this.dataParams.modelParams[i].key]);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
catch (error) {
|
|
263
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
264
|
-
status: 422, message: 'validateForSave was unsuccessful',
|
|
265
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-220`,
|
|
266
|
-
error: error
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* setting up dependency dataHook by DynamoBEDataModelParams
|
|
273
|
-
*/
|
|
274
|
-
lookForDependencyDataSettings() {
|
|
275
|
-
const dependencyParam = this.dataParams.modelParams.find((modelParams) => modelParams.isDependencyHook);
|
|
276
|
-
if (dependencyParam) {
|
|
277
|
-
this.depKey = dependencyParam.key;
|
|
278
|
-
if (dependencyParam.dependencyName) {
|
|
279
|
-
this.depDBServiceKey = dependencyParam.dependencyName;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
*
|
|
285
|
-
* @returns
|
|
286
|
-
*/
|
|
287
|
-
getDependencyDataDBService() {
|
|
288
|
-
if (this.depDBServiceKey) {
|
|
289
|
-
return dynamobe_global_service_1.DBE_Global_S.getDBService(this.dataParams);
|
|
290
|
-
}
|
|
291
|
-
else {
|
|
292
|
-
throw new fsm_dynamo_1.DynamoBEError({
|
|
293
|
-
status: 501, message: 'getDependencyDataDBService was unsuccessful, service key not setted up!',
|
|
294
|
-
userMessage: `We encountered a DB Error, please contact the responsible development team. \nerrorCode: 744-234-200`,
|
|
295
|
-
error: new Error()
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
exports.DynamoBEDataService = DynamoBEDataService;
|
|
301
|
-
//# sourceMappingURL=dynamobe-data.service.js.map
|
|
@@ -1 +0,0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CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;yBACvG;qBACF;iBACF;aACF;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,0BAAa,CAAC;oBACtB,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,kCAAkC;oBACxD,WAAW,EAAE,oGAAoG;oBACjH,KAAK,EAAE,KAAK;iBACb,CAAC,CAAC;aACJ;QACH,CAAC;KAAA;IAED;;OAEG;IACK,6BAA6B;QACnC,MAAM,eAAe,GAA+B,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,WAAuC,EAAE,EAAE,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAChK,IAAI,eAAe,EAAE;YACnB,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC;YAClC,IAAI,eAAe,CAAC,cAAc,EAAE;gBAClC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC,cAAc,CAAC;aACvD;SACF;IACH,CAAC;IAED;;;OAGG;IACH,0BAA0B;QACxB,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,OAAO,sCAAY,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACnD;aAAM;YACL,MAAM,IAAI,0BAAa,CAAC;gBACtB,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,yEAAyE;gBAC/F,WAAW,EAAE,oGAAoG;gBACjH,KAAK,EAAE,IAAI,KAAK,EAAE;aACnB,CAAC,CAAC;SACJ;IACH,CAAC;CACF;AA5RD,kDA4RC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DynamoBEDBService } from './dynamobe-db.service';
|
|
2
|
-
import { DynamoBESingletonService } from './dynamobe-singleton.service';
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export declare class DynamoBEDBServiceCollection extends DynamoBESingletonService {
|
|
7
|
-
[service: string]: DynamoBEDBService<any>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=dynamobe-db-service-collection.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-db-service-collection.service.d.ts","sourceRoot":"","sources":["../../src/_services/dynamobe-db-service-collection.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,wBAAwB;IAEvE,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;CAE3C"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DynamoBEDBServiceCollection = void 0;
|
|
4
|
-
const dynamobe_singleton_service_1 = require("./dynamobe-singleton.service");
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
class DynamoBEDBServiceCollection extends dynamobe_singleton_service_1.DynamoBESingletonService {
|
|
9
|
-
}
|
|
10
|
-
exports.DynamoBEDBServiceCollection = DynamoBEDBServiceCollection;
|
|
11
|
-
//# sourceMappingURL=dynamobe-db-service-collection.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-db-service-collection.service.js","sourceRoot":"","sources":["../../src/_services/dynamobe-db-service-collection.service.ts"],"names":[],"mappings":";;;AAEA,6EAAwE;AAExE;;GAEG;AACH,MAAa,2BAA4B,SAAQ,qDAAwB;CAIxE;AAJD,kEAIC"}
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import * as mongoose from 'mongoose';
|
|
2
|
-
import { Dynamo_Metadata, DynamoBEDataParams } from '@futdevpro/fsm-dynamo';
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export declare class DynamoBEDBService<T extends Dynamo_Metadata> {
|
|
7
|
-
dataParams: DynamoBEDataParams;
|
|
8
|
-
dataModel: mongoose.Model<mongoose.Document<any, any, any>, any, any>;
|
|
9
|
-
private depDataName;
|
|
10
|
-
/**
|
|
11
|
-
* @param dataName name the model
|
|
12
|
-
* @param typeSample sample data for scheme creation (dont include Dynamo_Metadata!)
|
|
13
|
-
* @param schemaSettings additional settings for specific parameters as unique, required, minlength or maxlength
|
|
14
|
-
* schemaSettings also MUST contain specific types that differs from the listed above (Array, Date)
|
|
15
|
-
*/
|
|
16
|
-
constructor(dataParams: DynamoBEDataParams);
|
|
17
|
-
/**
|
|
18
|
-
* save new data
|
|
19
|
-
* @param data data
|
|
20
|
-
* @returns data
|
|
21
|
-
*/
|
|
22
|
-
createData(data: T, creator: string): Promise<T>;
|
|
23
|
-
/**
|
|
24
|
-
* Find data by _id and update
|
|
25
|
-
* @param data data
|
|
26
|
-
* @returns data
|
|
27
|
-
*/
|
|
28
|
-
modifyData(data: T, modifier: string): Promise<T>;
|
|
29
|
-
/**
|
|
30
|
-
* returns data by _id, throws error if not found
|
|
31
|
-
* @param id id
|
|
32
|
-
* @returns data
|
|
33
|
-
*/
|
|
34
|
-
getDataById(id: string): Promise<T>;
|
|
35
|
-
/**
|
|
36
|
-
* get data by dependency data id, throws error if not found
|
|
37
|
-
* @param dependencyId id
|
|
38
|
-
* @returns data
|
|
39
|
-
*/
|
|
40
|
-
getDataByDependencyId(dependencyId: string): Promise<T>;
|
|
41
|
-
/**
|
|
42
|
-
* get data by dependency data id, throws error if not found
|
|
43
|
-
* @param dependencyId id
|
|
44
|
-
* @returns dataList
|
|
45
|
-
*/
|
|
46
|
-
getDataListByDependencyId(dependencyId: string): Promise<T[]>;
|
|
47
|
-
/**
|
|
48
|
-
* get multiple data objects by a list of DependencyIDs, throws error if not found
|
|
49
|
-
* @param ids ids
|
|
50
|
-
* @returns dataList
|
|
51
|
-
*/
|
|
52
|
-
getDataListByDependencyIds(ids: string[]): Promise<T[]>;
|
|
53
|
-
/**
|
|
54
|
-
* returns search result for searchBy object params
|
|
55
|
-
* can use lists or xRange values for searchBy obj properties
|
|
56
|
-
* @param searchBy filter
|
|
57
|
-
* @param narrowByDependencyIds id
|
|
58
|
-
* @returns dataList
|
|
59
|
-
*/
|
|
60
|
-
searchData(searchBy: object, narrowByDependencyIds?: string[]): Promise<T[]>;
|
|
61
|
-
/**
|
|
62
|
-
* find data by any of its parameters, throws error if not found
|
|
63
|
-
* @param data
|
|
64
|
-
* (always use unique parameters for find!)
|
|
65
|
-
* etc.: by email:
|
|
66
|
-
* { email: email }
|
|
67
|
-
* or by id that is in list:
|
|
68
|
-
* { userIds: { $in: this.userId } }
|
|
69
|
-
* or by number or Date that is greater than OR less than:
|
|
70
|
-
* { points: { $gte: 2, $lte: 14 } }
|
|
71
|
-
* @returns data
|
|
72
|
-
*/
|
|
73
|
-
/**
|
|
74
|
-
* returns all data from database, throws error if not found
|
|
75
|
-
* @returns dataList
|
|
76
|
-
*/
|
|
77
|
-
getAll(): Promise<T[]>;
|
|
78
|
-
/**
|
|
79
|
-
* deleted data by id
|
|
80
|
-
* @param id id
|
|
81
|
-
*/
|
|
82
|
-
deleteDataById(id: string): Promise<void>;
|
|
83
|
-
/**
|
|
84
|
-
* deleted data by id
|
|
85
|
-
* @param dependencyId id
|
|
86
|
-
*/
|
|
87
|
-
deleteDataByDependencyId(dependencyId: string): Promise<void>;
|
|
88
|
-
/**
|
|
89
|
-
* find the data first by any of its parameters, throws error if not found
|
|
90
|
-
* @param filter
|
|
91
|
-
* (always use unique parameters for find!)
|
|
92
|
-
* etc.: by email:
|
|
93
|
-
* { email: email }
|
|
94
|
-
* or by id that is in list:
|
|
95
|
-
* { userIds: { $in: this.userId } }
|
|
96
|
-
* or by number or Date that is GREATER THAN OR LESS THAN:
|
|
97
|
-
* { points: { $gt: 2, $lt: 14 } }
|
|
98
|
-
* further tools (syntax matches with $gt):
|
|
99
|
-
* $eq: Matches values that are EQUAL to a specified value.
|
|
100
|
-
* $gte: Matches values that are GREATER THAN or EQUAL to a specified value.
|
|
101
|
-
* $lte: Matches values that are LESS THAN or EQUAL to a specified value.
|
|
102
|
-
* $ne: Matches all values that are NOT EQUAL to a specified value.
|
|
103
|
-
* $nin: Matches NONE of the values specified IN an array.
|
|
104
|
-
*
|
|
105
|
-
* @returns data
|
|
106
|
-
*/
|
|
107
|
-
findOne(filter: any): Promise<T>;
|
|
108
|
-
/**
|
|
109
|
-
* find all data by any of its parameters, throws error if not found
|
|
110
|
-
* @param filter
|
|
111
|
-
* etc.: by email:
|
|
112
|
-
* { email: email }
|
|
113
|
-
* or by id that is in list:
|
|
114
|
-
* { userIds: { $in: this.userId } }
|
|
115
|
-
* or by number or Date that is GREATER THAN OR LESS THAN:
|
|
116
|
-
* { points: { $gt: 2, $lt: 14 } }
|
|
117
|
-
* further tools (syntax matches with $gt):
|
|
118
|
-
* $eq: Matches values that are EQUAL to a specified value.
|
|
119
|
-
* $gte: Matches values that are GREATER THAN or EQUAL to a specified value.
|
|
120
|
-
* $lte: Matches values that are LESS THAN or EQUAL to a specified value.
|
|
121
|
-
* $ne: Matches all values that are NOT EQUAL to a specified value.
|
|
122
|
-
* $nin: Matches NONE of the values specified IN an array.
|
|
123
|
-
*
|
|
124
|
-
* @returns dataList
|
|
125
|
-
*/
|
|
126
|
-
find(filter: any): Promise<T[]>;
|
|
127
|
-
/**
|
|
128
|
-
* find all data by any of its parameters, throws error if not found
|
|
129
|
-
* @param filter
|
|
130
|
-
* etc.: by email:
|
|
131
|
-
* { email: email }
|
|
132
|
-
* or by id that is in list:
|
|
133
|
-
* { userIds: { $in: this.userId } }
|
|
134
|
-
* or by number or Date that is GREATER THAN OR LESS THAN:
|
|
135
|
-
* { points: { $gt: 2, $lt: 14 } }
|
|
136
|
-
* further tools (syntax matches with $gt):
|
|
137
|
-
* $eq: Matches values that are EQUAL to a specified value.
|
|
138
|
-
* $gte: Matches values that are GREATER THAN or EQUAL to a specified value.
|
|
139
|
-
* $lte: Matches values that are LESS THAN or EQUAL to a specified value.
|
|
140
|
-
* $ne: Matches all values that are NOT EQUAL to a specified value.
|
|
141
|
-
* $nin: Matches NONE of the values specified IN an array.
|
|
142
|
-
*
|
|
143
|
-
* @param page page
|
|
144
|
-
* @param pageSize pageSize
|
|
145
|
-
* @param sort etc. by dateTime: { dateTime: -1 }
|
|
146
|
-
* @returns dataList
|
|
147
|
-
*/
|
|
148
|
-
findWithPaging(filter: any, page: number, pageSize: number, sort?: any): Promise<T[]>;
|
|
149
|
-
/**
|
|
150
|
-
* Find data by _id and update
|
|
151
|
-
* @param id id
|
|
152
|
-
* @param update update
|
|
153
|
-
* @returns data
|
|
154
|
-
*/
|
|
155
|
-
findByIdAndUpdate(id: string, update: any, modifier: string): Promise<T>;
|
|
156
|
-
/**
|
|
157
|
-
* update one parameter by a specific
|
|
158
|
-
* @param updateBy
|
|
159
|
-
* (always use unique parameters for find!)
|
|
160
|
-
* etc.: by email:
|
|
161
|
-
* { email: email }
|
|
162
|
-
* or by id that is in list:
|
|
163
|
-
* { userIds: { $in: this.userId } }
|
|
164
|
-
* or by number or Date that is GREATER THAN OR LESS THAN:
|
|
165
|
-
* { points: { $gt: 2, $lt: 14 } }
|
|
166
|
-
* further tools (syntax matches with $gt):
|
|
167
|
-
* $eq: Matches values that are EQUAL to a specified value.
|
|
168
|
-
* $gte: Matches values that are GREATER THAN or EQUAL to a specified value.
|
|
169
|
-
* $lte: Matches values that are LESS THAN or EQUAL to a specified value.
|
|
170
|
-
* $ne: Matches all values that are NOT EQUAL to a specified value.
|
|
171
|
-
* $nin: Matches NONE of the values specified IN an array.
|
|
172
|
-
*
|
|
173
|
-
* @param update
|
|
174
|
-
* etc.: increase a specific value:
|
|
175
|
-
* { $inc: { popularity: 15 } }
|
|
176
|
-
* or add element to a list:
|
|
177
|
-
* { $push: { reactions: this.newReaction }
|
|
178
|
-
* or all at once
|
|
179
|
-
* { $inc: { popularity: this.newVote.amount }, emailVerified: true, $push: { reactions: this.newReaction } }
|
|
180
|
-
* further tools (syntax matches with $inc):
|
|
181
|
-
* $currentDate: Sets the value of a field to current date, either as a Date or a Timestamp.
|
|
182
|
-
* $min: Only updates the field if the specified value is less than the existing field value.
|
|
183
|
-
* $max: Only updates the field if the specified value is greater than the existing field value.
|
|
184
|
-
* $mul: Multiplies the value of the field by the specified amount.
|
|
185
|
-
* $rename: Renames a field.
|
|
186
|
-
* $unset: Removes the specified field from a document. (set: "" to value)
|
|
187
|
-
*/
|
|
188
|
-
updateOne(updateBy: any, update: any, modifier: string): Promise<void>;
|
|
189
|
-
/**
|
|
190
|
-
* update one parameter by a specific
|
|
191
|
-
* @param updateBy
|
|
192
|
-
* etc.: by email:
|
|
193
|
-
* { email: email }
|
|
194
|
-
* or by id that is in list:
|
|
195
|
-
* { userIds: { $in: this.userId } }
|
|
196
|
-
* or by number or Date that is GREATER THAN OR LESS THAN:
|
|
197
|
-
* { points: { $gt: 2, $lt: 14 } }
|
|
198
|
-
* further tools (syntax matches with $gt):
|
|
199
|
-
* $eq: Matches values that are EQUAL to a specified value.
|
|
200
|
-
* $gte: Matches values that are GREATER THAN or EQUAL to a specified value.
|
|
201
|
-
* $lte: Matches values that are LESS THAN or EQUAL to a specified value.
|
|
202
|
-
* $ne: Matches all values that are NOT EQUAL to a specified value.
|
|
203
|
-
* $nin: Matches NONE of the values specified IN an array.
|
|
204
|
-
*
|
|
205
|
-
* @param update
|
|
206
|
-
* etc.: increase a specific value:
|
|
207
|
-
* { $inc: { popularity: 15 } }
|
|
208
|
-
* or add element to a list:
|
|
209
|
-
* { $push: { reactions: this.newReaction }
|
|
210
|
-
* or all at once
|
|
211
|
-
* { $inc: { popularity: this.newVote.amount }, emailVerified: true, $push: { reactions: this.newReaction } }
|
|
212
|
-
* further tools (syntax matches with $inc):
|
|
213
|
-
* $currentDate: Sets the value of a field to current date, either as a Date or a Timestamp.
|
|
214
|
-
* $min: Only updates the field if the specified value is less than the existing field value.
|
|
215
|
-
* $max: Only updates the field if the specified value is greater than the existing field value.
|
|
216
|
-
* $mul: Multiplies the value of the field by the specified amount.
|
|
217
|
-
* $rename: Renames a field.
|
|
218
|
-
* $unset: Removes the specified field from a document. (set: "" to value)
|
|
219
|
-
*/
|
|
220
|
-
updateMany(updateBy: any, update: any, modifier: string): Promise<void>;
|
|
221
|
-
/**
|
|
222
|
-
* builds and returns mongoose schema
|
|
223
|
-
* @returns schema
|
|
224
|
-
*/
|
|
225
|
-
private getSchema;
|
|
226
|
-
/**
|
|
227
|
-
* builds mongoose schema building settings object by dynamoDataModelParamsList
|
|
228
|
-
* @param params DynamoBEDataPropertyParams
|
|
229
|
-
* @returns mongoose schema object
|
|
230
|
-
*/
|
|
231
|
-
private buildMongooseSchemaByModelParams;
|
|
232
|
-
private getBEType;
|
|
233
|
-
/**
|
|
234
|
-
* adds dynamo metadata settings to any mongoose schema building settings object
|
|
235
|
-
* @param schema schema to update
|
|
236
|
-
* @returns updated schema
|
|
237
|
-
*/
|
|
238
|
-
private addDynamo_MetadataToSchema;
|
|
239
|
-
/**
|
|
240
|
-
* sets depDataKey
|
|
241
|
-
*/
|
|
242
|
-
private lookForDependencyDataSettings;
|
|
243
|
-
}
|
|
244
|
-
//# sourceMappingURL=dynamobe-db.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamobe-db.service.d.ts","sourceRoot":"","sources":["../../src/_services/dynamobe-db.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAA6C,MAAM,uBAAuB,CAAC;AAEhH;;GAEG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,QAAQ;IAYtC,UAAU,EAAE,kBAAkB;IAXvC,SAAS,6DAA4D;IAErE,OAAO,CAAC,WAAW,CAAS;IAE5B;;;;;OAKG;gBAEM,UAAU,EAAE,kBAAkB;IAKvC;;;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