@smartsoft001/auth-shell-nestjs 2.112.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
|
@@ -40,6 +40,15 @@ import { TypeOrmModule } from "@nestjs/typeorm";
|
|
|
40
40
|
// packages/auth/domain/src/lib/entities/user.entity.ts
|
|
41
41
|
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
|
|
42
42
|
var User = class {
|
|
43
|
+
id;
|
|
44
|
+
permissions;
|
|
45
|
+
username;
|
|
46
|
+
password;
|
|
47
|
+
disabled;
|
|
48
|
+
lastLoginDate;
|
|
49
|
+
authRefreshToken;
|
|
50
|
+
facebookUserId;
|
|
51
|
+
googleUserId;
|
|
43
52
|
};
|
|
44
53
|
__decorateClass([
|
|
45
54
|
PrimaryGeneratedColumn()
|
|
@@ -118,83 +127,11 @@ var PasswordService = class _PasswordService {
|
|
|
118
127
|
}
|
|
119
128
|
};
|
|
120
129
|
|
|
121
|
-
// packages/shared/utils/src/lib/services/remove-html/remove-html.service.ts
|
|
122
|
-
var RemoveHtmlService = class {
|
|
123
|
-
/**
|
|
124
|
-
* Remove HTML tags and decode HTML entities from text
|
|
125
|
-
* - Removes HTML tags
|
|
126
|
-
* - Decodes common named entities ( , ", etc.)
|
|
127
|
-
* - Decodes numeric entities ({ or «)
|
|
128
|
-
* - Removes any remaining unrecognized entities
|
|
129
|
-
*/
|
|
130
|
-
static create(val) {
|
|
131
|
-
if (!val) {
|
|
132
|
-
return "";
|
|
133
|
-
}
|
|
134
|
-
let result = val;
|
|
135
|
-
result = result.replace(/<[^>]*(>|$)/g, "");
|
|
136
|
-
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, "");
|
|
137
|
-
result = result.replace(/&#(\d+);/g, (match, dec) => String.fromCharCode(dec)).replace(
|
|
138
|
-
/&#x([0-9a-f]+);/gi,
|
|
139
|
-
(match, hex) => String.fromCharCode(parseInt(hex, 16))
|
|
140
|
-
);
|
|
141
|
-
result = result.replace(/&[a-z]+;/gi, "");
|
|
142
|
-
return result;
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
// packages/shared/utils/src/lib/services/slug/slug.service.ts
|
|
147
|
-
var SlugService = class _SlugService {
|
|
148
|
-
static {
|
|
149
|
-
this.polishToEnglishMap = {
|
|
150
|
-
\u0105: "a",
|
|
151
|
-
\u0107: "c",
|
|
152
|
-
\u0119: "e",
|
|
153
|
-
\u0142: "l",
|
|
154
|
-
\u0144: "n",
|
|
155
|
-
\u00F3: "o",
|
|
156
|
-
\u015B: "s",
|
|
157
|
-
\u017A: "z",
|
|
158
|
-
\u017C: "z",
|
|
159
|
-
\u0104: "A",
|
|
160
|
-
\u0106: "C",
|
|
161
|
-
\u0118: "E",
|
|
162
|
-
\u0141: "L",
|
|
163
|
-
\u0143: "N",
|
|
164
|
-
\u00D3: "O",
|
|
165
|
-
\u015A: "S",
|
|
166
|
-
\u0179: "Z",
|
|
167
|
-
\u017B: "Z"
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Convert text to URL-friendly slug
|
|
172
|
-
* - Removes HTML tags and entities
|
|
173
|
-
* - Replaces Polish characters with English equivalents
|
|
174
|
-
* - Converts to lowercase
|
|
175
|
-
* - Replaces spaces and special characters with hyphens
|
|
176
|
-
* - Removes multiple consecutive hyphens
|
|
177
|
-
* - Trims hyphens from start and end
|
|
178
|
-
*/
|
|
179
|
-
static create(text) {
|
|
180
|
-
if (!text) {
|
|
181
|
-
return "";
|
|
182
|
-
}
|
|
183
|
-
let slug = RemoveHtmlService.create(text);
|
|
184
|
-
slug = slug.split("").map((char) => _SlugService.polishToEnglishMap[char] || char).join("");
|
|
185
|
-
slug = slug.toLowerCase();
|
|
186
|
-
slug = slug.replace(/[^a-z0-9]+/g, "-");
|
|
187
|
-
slug = slug.replace(/-+/g, "-");
|
|
188
|
-
slug = slug.replace(/^-+|-+$/g, "");
|
|
189
|
-
return slug;
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
130
|
// packages/shared/domain-core/src/lib/errors.ts
|
|
194
131
|
var DomainValidationError = class _DomainValidationError extends Error {
|
|
132
|
+
type = _DomainValidationError;
|
|
195
133
|
constructor(msg) {
|
|
196
134
|
super(msg);
|
|
197
|
-
this.type = _DomainValidationError;
|
|
198
135
|
}
|
|
199
136
|
};
|
|
200
137
|
|
|
@@ -206,8 +143,8 @@ var TokenFactory = class {
|
|
|
206
143
|
this.jwtService = jwtService;
|
|
207
144
|
this.fbService = fbService;
|
|
208
145
|
this.googleService = googleService;
|
|
209
|
-
this._invalidUsernameOrPasswordMessage = "Invalid username or password";
|
|
210
146
|
}
|
|
147
|
+
_invalidUsernameOrPasswordMessage = "Invalid username or password";
|
|
211
148
|
static getQuery(config, customProvider = false) {
|
|
212
149
|
switch (config.grant_type) {
|
|
213
150
|
case "fb":
|
|
@@ -338,9 +275,9 @@ TokenFactory = __decorateClass([
|
|
|
338
275
|
// packages/auth/domain/src/lib/feature-create-token/token.config.ts
|
|
339
276
|
import { Injectable as Injectable2 } from "@nestjs/common";
|
|
340
277
|
var TokenConfig = class {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
278
|
+
expiredIn;
|
|
279
|
+
clients = [];
|
|
280
|
+
secretOrPrivateKey;
|
|
344
281
|
};
|
|
345
282
|
TokenConfig = __decorateClass([
|
|
346
283
|
Injectable2()
|