@smartsoft001/auth-shell-app-services 2.101.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
@@ -64,6 +64,15 @@ import "reflect-metadata";
64
64
  // packages/shared/models/src/lib/decorators/field/field.decorator.ts
65
65
  import "reflect-metadata";
66
66
 
67
+ // packages/shared/utils/src/lib/services/array/array.service.ts
68
+ import * as _ from "lodash";
69
+
70
+ // packages/shared/utils/src/lib/services/guid/guid.service.ts
71
+ import { Guid } from "guid-typescript";
72
+
73
+ // packages/shared/utils/src/lib/services/object/object.service.ts
74
+ import { stringify } from "flatted";
75
+
67
76
  // packages/shared/utils/src/lib/services/password/password.service.ts
68
77
  import md5 from "md5";
69
78
  var PasswordService = class _PasswordService {
@@ -86,14 +95,52 @@ var PasswordService = class _PasswordService {
86
95
  }
87
96
  };
88
97
 
89
- // packages/shared/utils/src/lib/services/object/object.service.ts
90
- import { stringify } from "flatted";
91
-
92
- // packages/shared/utils/src/lib/services/guid/guid.service.ts
93
- import { Guid } from "guid-typescript";
94
-
95
- // packages/shared/utils/src/lib/services/array/array.service.ts
96
- import * as _ from "lodash";
98
+ // packages/shared/utils/src/lib/services/slug/slug.service.ts
99
+ var SlugService = class _SlugService {
100
+ static {
101
+ this.polishToEnglishMap = {
102
+ "\u0105": "a",
103
+ "\u0107": "c",
104
+ "\u0119": "e",
105
+ "\u0142": "l",
106
+ "\u0144": "n",
107
+ "\xF3": "o",
108
+ "\u015B": "s",
109
+ "\u017A": "z",
110
+ "\u017C": "z",
111
+ "\u0104": "A",
112
+ "\u0106": "C",
113
+ "\u0118": "E",
114
+ "\u0141": "L",
115
+ "\u0143": "N",
116
+ "\xD3": "O",
117
+ "\u015A": "S",
118
+ "\u0179": "Z",
119
+ "\u017B": "Z"
120
+ };
121
+ }
122
+ /**
123
+ * Convert text to URL-friendly slug
124
+ * - Replaces Polish characters with English equivalents
125
+ * - Converts to lowercase
126
+ * - Replaces spaces and special characters with hyphens
127
+ * - Removes multiple consecutive hyphens
128
+ * - Trims hyphens from start and end
129
+ */
130
+ static create(text) {
131
+ if (!text) {
132
+ return "";
133
+ }
134
+ let slug = text.split("").map(
135
+ (char) => _SlugService.polishToEnglishMap[char] || char
136
+ ).join("");
137
+ slug = slug.toLowerCase();
138
+ slug = slug.replace(/[^a-z0-9]+/g, "-");
139
+ slug = slug.replace(/-+/g, "-");
140
+ slug = slug.replace(/^-+|-+$/g, "");
141
+ return slug;
142
+ }
143
+ };
97
144
 
98
145
  // packages/shared/domain-core/src/lib/errors.ts
99
146
  var DomainValidationError = class _DomainValidationError extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartsoft001/auth-shell-app-services",
3
- "version": "2.101.0",
3
+ "version": "2.102.0",
4
4
  "description": "Utils to authorization",
5
5
  "repository": {
6
6
  "type": "git",