@smartsoft001/auth-shell-nestjs 2.100.0 → 2.102.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.
Files changed (2) hide show
  1. package/index.js +55 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -87,6 +87,15 @@ import "reflect-metadata";
87
87
  // packages/shared/models/src/lib/decorators/field/field.decorator.ts
88
88
  import "reflect-metadata";
89
89
 
90
+ // packages/shared/utils/src/lib/services/array/array.service.ts
91
+ import * as _ from "lodash";
92
+
93
+ // packages/shared/utils/src/lib/services/guid/guid.service.ts
94
+ import { Guid } from "guid-typescript";
95
+
96
+ // packages/shared/utils/src/lib/services/object/object.service.ts
97
+ import { stringify } from "flatted";
98
+
90
99
  // packages/shared/utils/src/lib/services/password/password.service.ts
91
100
  import md5 from "md5";
92
101
  var PasswordService = class _PasswordService {
@@ -109,14 +118,52 @@ var PasswordService = class _PasswordService {
109
118
  }
110
119
  };
111
120
 
112
- // packages/shared/utils/src/lib/services/object/object.service.ts
113
- import { stringify } from "flatted";
114
-
115
- // packages/shared/utils/src/lib/services/guid/guid.service.ts
116
- import { Guid } from "guid-typescript";
117
-
118
- // packages/shared/utils/src/lib/services/array/array.service.ts
119
- import * as _ from "lodash";
121
+ // packages/shared/utils/src/lib/services/slug/slug.service.ts
122
+ var SlugService = class _SlugService {
123
+ static {
124
+ this.polishToEnglishMap = {
125
+ "\u0105": "a",
126
+ "\u0107": "c",
127
+ "\u0119": "e",
128
+ "\u0142": "l",
129
+ "\u0144": "n",
130
+ "\xF3": "o",
131
+ "\u015B": "s",
132
+ "\u017A": "z",
133
+ "\u017C": "z",
134
+ "\u0104": "A",
135
+ "\u0106": "C",
136
+ "\u0118": "E",
137
+ "\u0141": "L",
138
+ "\u0143": "N",
139
+ "\xD3": "O",
140
+ "\u015A": "S",
141
+ "\u0179": "Z",
142
+ "\u017B": "Z"
143
+ };
144
+ }
145
+ /**
146
+ * Convert text to URL-friendly slug
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 = text.split("").map(
158
+ (char) => _SlugService.polishToEnglishMap[char] || char
159
+ ).join("");
160
+ slug = slug.toLowerCase();
161
+ slug = slug.replace(/[^a-z0-9]+/g, "-");
162
+ slug = slug.replace(/-+/g, "-");
163
+ slug = slug.replace(/^-+|-+$/g, "");
164
+ return slug;
165
+ }
166
+ };
120
167
 
121
168
  // packages/shared/domain-core/src/lib/errors.ts
122
169
  var DomainValidationError = class _DomainValidationError extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartsoft001/auth-shell-nestjs",
3
- "version": "2.100.0",
3
+ "version": "2.102.0",
4
4
  "description": "Utils for authorization",
5
5
  "repository": {
6
6
  "type": "git",