@smartsoft001/auth-domain 2.111.0 → 2.113.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 +14 -77
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -14,6 +14,15 @@ var __decorateParam = (index, decorator) => (target, key) => decorator(target, k
|
|
|
14
14
|
// packages/auth/domain/src/lib/entities/user.entity.ts
|
|
15
15
|
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
|
|
16
16
|
var User = class {
|
|
17
|
+
id;
|
|
18
|
+
permissions;
|
|
19
|
+
username;
|
|
20
|
+
password;
|
|
21
|
+
disabled;
|
|
22
|
+
lastLoginDate;
|
|
23
|
+
authRefreshToken;
|
|
24
|
+
facebookUserId;
|
|
25
|
+
googleUserId;
|
|
17
26
|
};
|
|
18
27
|
__decorateClass([
|
|
19
28
|
PrimaryGeneratedColumn()
|
|
@@ -92,83 +101,11 @@ var PasswordService = class _PasswordService {
|
|
|
92
101
|
}
|
|
93
102
|
};
|
|
94
103
|
|
|
95
|
-
// packages/shared/utils/src/lib/services/remove-html/remove-html.service.ts
|
|
96
|
-
var RemoveHtmlService = class {
|
|
97
|
-
/**
|
|
98
|
-
* Remove HTML tags and decode HTML entities from text
|
|
99
|
-
* - Removes HTML tags
|
|
100
|
-
* - Decodes common named entities ( , ", etc.)
|
|
101
|
-
* - Decodes numeric entities ({ or «)
|
|
102
|
-
* - Removes any remaining unrecognized entities
|
|
103
|
-
*/
|
|
104
|
-
static create(val) {
|
|
105
|
-
if (!val) {
|
|
106
|
-
return "";
|
|
107
|
-
}
|
|
108
|
-
let result = val;
|
|
109
|
-
result = result.replace(/<[^>]*(>|$)/g, "");
|
|
110
|
-
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, "");
|
|
111
|
-
result = result.replace(/&#(\d+);/g, (match, dec) => String.fromCharCode(dec)).replace(
|
|
112
|
-
/&#x([0-9a-f]+);/gi,
|
|
113
|
-
(match, hex) => String.fromCharCode(parseInt(hex, 16))
|
|
114
|
-
);
|
|
115
|
-
result = result.replace(/&[a-z]+;/gi, "");
|
|
116
|
-
return result;
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
// packages/shared/utils/src/lib/services/slug/slug.service.ts
|
|
121
|
-
var SlugService = class _SlugService {
|
|
122
|
-
static {
|
|
123
|
-
this.polishToEnglishMap = {
|
|
124
|
-
\u0105: "a",
|
|
125
|
-
\u0107: "c",
|
|
126
|
-
\u0119: "e",
|
|
127
|
-
\u0142: "l",
|
|
128
|
-
\u0144: "n",
|
|
129
|
-
\u00F3: "o",
|
|
130
|
-
\u015B: "s",
|
|
131
|
-
\u017A: "z",
|
|
132
|
-
\u017C: "z",
|
|
133
|
-
\u0104: "A",
|
|
134
|
-
\u0106: "C",
|
|
135
|
-
\u0118: "E",
|
|
136
|
-
\u0141: "L",
|
|
137
|
-
\u0143: "N",
|
|
138
|
-
\u00D3: "O",
|
|
139
|
-
\u015A: "S",
|
|
140
|
-
\u0179: "Z",
|
|
141
|
-
\u017B: "Z"
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Convert text to URL-friendly slug
|
|
146
|
-
* - Removes HTML tags and entities
|
|
147
|
-
* - Replaces Polish characters with English equivalents
|
|
148
|
-
* - Converts to lowercase
|
|
149
|
-
* - Replaces spaces and special characters with hyphens
|
|
150
|
-
* - Removes multiple consecutive hyphens
|
|
151
|
-
* - Trims hyphens from start and end
|
|
152
|
-
*/
|
|
153
|
-
static create(text) {
|
|
154
|
-
if (!text) {
|
|
155
|
-
return "";
|
|
156
|
-
}
|
|
157
|
-
let slug = RemoveHtmlService.create(text);
|
|
158
|
-
slug = slug.split("").map((char) => _SlugService.polishToEnglishMap[char] || char).join("");
|
|
159
|
-
slug = slug.toLowerCase();
|
|
160
|
-
slug = slug.replace(/[^a-z0-9]+/g, "-");
|
|
161
|
-
slug = slug.replace(/-+/g, "-");
|
|
162
|
-
slug = slug.replace(/^-+|-+$/g, "");
|
|
163
|
-
return slug;
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
104
|
// packages/shared/domain-core/src/lib/errors.ts
|
|
168
105
|
var DomainValidationError = class _DomainValidationError extends Error {
|
|
106
|
+
type = _DomainValidationError;
|
|
169
107
|
constructor(msg) {
|
|
170
108
|
super(msg);
|
|
171
|
-
this.type = _DomainValidationError;
|
|
172
109
|
}
|
|
173
110
|
};
|
|
174
111
|
|
|
@@ -180,8 +117,8 @@ var TokenFactory = class {
|
|
|
180
117
|
this.jwtService = jwtService;
|
|
181
118
|
this.fbService = fbService;
|
|
182
119
|
this.googleService = googleService;
|
|
183
|
-
this._invalidUsernameOrPasswordMessage = "Invalid username or password";
|
|
184
120
|
}
|
|
121
|
+
_invalidUsernameOrPasswordMessage = "Invalid username or password";
|
|
185
122
|
static getQuery(config, customProvider = false) {
|
|
186
123
|
switch (config.grant_type) {
|
|
187
124
|
case "fb":
|
|
@@ -312,9 +249,9 @@ TokenFactory = __decorateClass([
|
|
|
312
249
|
// packages/auth/domain/src/lib/feature-create-token/token.config.ts
|
|
313
250
|
import { Injectable as Injectable2 } from "@nestjs/common";
|
|
314
251
|
var TokenConfig = class {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
252
|
+
expiredIn;
|
|
253
|
+
clients = [];
|
|
254
|
+
secretOrPrivateKey;
|
|
318
255
|
};
|
|
319
256
|
TokenConfig = __decorateClass([
|
|
320
257
|
Injectable2()
|