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