@smartsoft001/crud-shell-nestjs 2.112.0 → 2.114.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +16 -79
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -119,78 +119,6 @@ var PasswordService = class _PasswordService {
|
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
// packages/shared/utils/src/lib/services/remove-html/remove-html.service.ts
|
|
123
|
-
var RemoveHtmlService = class {
|
|
124
|
-
/**
|
|
125
|
-
* Remove HTML tags and decode HTML entities from text
|
|
126
|
-
* - Removes HTML tags
|
|
127
|
-
* - Decodes common named entities ( , ", etc.)
|
|
128
|
-
* - Decodes numeric entities ({ or «)
|
|
129
|
-
* - Removes any remaining unrecognized entities
|
|
130
|
-
*/
|
|
131
|
-
static create(val) {
|
|
132
|
-
if (!val) {
|
|
133
|
-
return "";
|
|
134
|
-
}
|
|
135
|
-
let result = val;
|
|
136
|
-
result = result.replace(/<[^>]*(>|$)/g, "");
|
|
137
|
-
result = result.replace(/ /g, " ").replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/„/g, "\u201E").replace(/”/g, '"').replace(/“/g, '"').replace(/«/g, "\xAB").replace(/»/g, "\xBB").replace(/‌/g, "");
|
|
138
|
-
result = result.replace(/&#(\d+);/g, (match, dec) => String.fromCharCode(dec)).replace(
|
|
139
|
-
/&#x([0-9a-f]+);/gi,
|
|
140
|
-
(match, hex) => String.fromCharCode(parseInt(hex, 16))
|
|
141
|
-
);
|
|
142
|
-
result = result.replace(/&[a-z]+;/gi, "");
|
|
143
|
-
return result;
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
// packages/shared/utils/src/lib/services/slug/slug.service.ts
|
|
148
|
-
var SlugService = class _SlugService {
|
|
149
|
-
static {
|
|
150
|
-
this.polishToEnglishMap = {
|
|
151
|
-
\u0105: "a",
|
|
152
|
-
\u0107: "c",
|
|
153
|
-
\u0119: "e",
|
|
154
|
-
\u0142: "l",
|
|
155
|
-
\u0144: "n",
|
|
156
|
-
\u00F3: "o",
|
|
157
|
-
\u015B: "s",
|
|
158
|
-
\u017A: "z",
|
|
159
|
-
\u017C: "z",
|
|
160
|
-
\u0104: "A",
|
|
161
|
-
\u0106: "C",
|
|
162
|
-
\u0118: "E",
|
|
163
|
-
\u0141: "L",
|
|
164
|
-
\u0143: "N",
|
|
165
|
-
\u00D3: "O",
|
|
166
|
-
\u015A: "S",
|
|
167
|
-
\u0179: "Z",
|
|
168
|
-
\u017B: "Z"
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Convert text to URL-friendly slug
|
|
173
|
-
* - Removes HTML tags and entities
|
|
174
|
-
* - Replaces Polish characters with English equivalents
|
|
175
|
-
* - Converts to lowercase
|
|
176
|
-
* - Replaces spaces and special characters with hyphens
|
|
177
|
-
* - Removes multiple consecutive hyphens
|
|
178
|
-
* - Trims hyphens from start and end
|
|
179
|
-
*/
|
|
180
|
-
static create(text) {
|
|
181
|
-
if (!text) {
|
|
182
|
-
return "";
|
|
183
|
-
}
|
|
184
|
-
let slug = RemoveHtmlService.create(text);
|
|
185
|
-
slug = slug.split("").map((char) => _SlugService.polishToEnglishMap[char] || char).join("");
|
|
186
|
-
slug = slug.toLowerCase();
|
|
187
|
-
slug = slug.replace(/[^a-z0-9]+/g, "-");
|
|
188
|
-
slug = slug.replace(/-+/g, "-");
|
|
189
|
-
slug = slug.replace(/^-+|-+$/g, "");
|
|
190
|
-
return slug;
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
|
|
194
122
|
// packages/shared/models/src/lib/utils.ts
|
|
195
123
|
function getModelFieldKeys(type) {
|
|
196
124
|
if (!type["__fields"])
|
|
@@ -253,15 +181,15 @@ function castModel(instance, mode, permissions) {
|
|
|
253
181
|
|
|
254
182
|
// packages/shared/domain-core/src/lib/errors.ts
|
|
255
183
|
var DomainValidationError = class _DomainValidationError extends Error {
|
|
184
|
+
type = _DomainValidationError;
|
|
256
185
|
constructor(msg) {
|
|
257
186
|
super(msg);
|
|
258
|
-
this.type = _DomainValidationError;
|
|
259
187
|
}
|
|
260
188
|
};
|
|
261
189
|
var DomainForbiddenError = class _DomainForbiddenError extends Error {
|
|
190
|
+
type = _DomainForbiddenError;
|
|
262
191
|
constructor(msg) {
|
|
263
192
|
super(msg);
|
|
264
|
-
this.type = _DomainForbiddenError;
|
|
265
193
|
}
|
|
266
194
|
};
|
|
267
195
|
|
|
@@ -279,8 +207,8 @@ var CrudService = class {
|
|
|
279
207
|
this.permissionService = permissionService;
|
|
280
208
|
this.repository = repository;
|
|
281
209
|
this.attachmentRepository = attachmentRepository;
|
|
282
|
-
this._logger = new Logger(CrudService.name, { timestamp: true });
|
|
283
210
|
}
|
|
211
|
+
_logger = new Logger(CrudService.name, { timestamp: true });
|
|
284
212
|
async create(data, user) {
|
|
285
213
|
data.id = Guid2.raw();
|
|
286
214
|
try {
|
|
@@ -469,6 +397,14 @@ var SERVICES = [CrudService];
|
|
|
469
397
|
|
|
470
398
|
// packages/shared/mongo/src/lib/mongo.config.ts
|
|
471
399
|
var MongoConfig = class {
|
|
400
|
+
host;
|
|
401
|
+
port;
|
|
402
|
+
database;
|
|
403
|
+
username;
|
|
404
|
+
password;
|
|
405
|
+
collection;
|
|
406
|
+
url;
|
|
407
|
+
type;
|
|
472
408
|
};
|
|
473
409
|
|
|
474
410
|
// packages/shared/mongo/src/lib/mongo.unitofwork.ts
|
|
@@ -1046,6 +982,9 @@ var MongoModule = class _MongoModule {
|
|
|
1046
982
|
// packages/shared/nestjs/src/lib/shared.config.ts
|
|
1047
983
|
import { Injectable as Injectable5 } from "@nestjs/common";
|
|
1048
984
|
var SharedConfig = class {
|
|
985
|
+
tokenConfig;
|
|
986
|
+
permissions;
|
|
987
|
+
type;
|
|
1049
988
|
};
|
|
1050
989
|
SharedConfig = __decorateClass([
|
|
1051
990
|
Injectable5()
|
|
@@ -1478,10 +1417,7 @@ function q2m(query = null, options = null) {
|
|
|
1478
1417
|
import { Injectable as Injectable8, UnauthorizedException, Logger as Logger3 } from "@nestjs/common";
|
|
1479
1418
|
import { AuthGuard } from "@nestjs/passport";
|
|
1480
1419
|
var AuthJwtGuard = class extends AuthGuard("jwt") {
|
|
1481
|
-
|
|
1482
|
-
super(...arguments);
|
|
1483
|
-
this.logger = new Logger3(AuthJwtGuard.name, { timestamp: true });
|
|
1484
|
-
}
|
|
1420
|
+
logger = new Logger3(AuthJwtGuard.name, { timestamp: true });
|
|
1485
1421
|
handleRequest(err, user, info) {
|
|
1486
1422
|
if (err || !user) {
|
|
1487
1423
|
this.logger.warn(JSON.stringify(info));
|
|
@@ -1794,6 +1730,7 @@ var CrudGateway = class {
|
|
|
1794
1730
|
constructor(service) {
|
|
1795
1731
|
this.service = service;
|
|
1796
1732
|
}
|
|
1733
|
+
_clientsSubscriptions;
|
|
1797
1734
|
handleFilter(data, client) {
|
|
1798
1735
|
const event = "changes";
|
|
1799
1736
|
return new Observable2((observer) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartsoft001/crud-shell-nestjs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.114.0",
|
|
4
4
|
"description": "Utils to crud",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"url": "https://github.com/emiljuchnikowski/smartsoft/issues"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@smartsoft001/crud-shell-app-services": "2.
|
|
20
|
+
"@smartsoft001/crud-shell-app-services": "2.114.0",
|
|
21
21
|
"@smartsoft001/crud-shell-dto": "*",
|
|
22
|
-
"@smartsoft001/domain-core": "2.
|
|
22
|
+
"@smartsoft001/domain-core": "2.114.0"
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://github.com/emiljuchnikowski/smartsoft#readme"
|
|
25
25
|
}
|